Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check if a computer on my network is online?

Tags:

c#

.net

I want to know how to check if a machine on my network is online, using only C#.

All machines on my network use the same OS (Windows 7) and I'm logged in as the same user on all machines.

My goal is to check if they are active, or open.

like image 485
pharaon450 Avatar asked May 30 '12 14:05

pharaon450


1 Answers

Simple:

Ping ping = new Ping();
PingReply pingReply = ping.Send("ip address here");

if(pingReply.Status == IPStatus.Success)
{
   //Machine is alive
}
like image 147
dtsg Avatar answered Oct 23 '22 03:10

dtsg