Make a program to check the operation (online) computers in LAN.
Google and modifications could create such a code:
private Boolean ping(String host)
using (var p = new Process())
p.StartInfo.FileName = "ping.exe";
p.StartInfo.Arguments = "-n 1 " + host;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.StandardOutputEncoding = Encoding.GetEncoding("CP866");
string output = p.StandardOutput.ReadToEnd();
Boolean status = output.Contains("TTL=");
But I feel that this bike with a bunch of crutches...
Is it possible somehow easier and more elegant to check if the computer knowing its ip?
Application C# Windows Form (.NET Framework)
PS in Python for example it's possible to do a couple of lines:
response = subprocess.call(["ping", "-c", "1", host], stdout=DNULL)
if response == 0:
I can't believe that in C# everything is so much more cumbersome...