如何检查,如果我的网络上的计算机在线? [英] How can I check if a computer on my network is online?

查看:142
本文介绍了如何检查,如果我的网络上的计算机在线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何检查,如果我的网络上的计算机处于联机状态,仅使用C#。

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

我的网络上所有的机器都使用相同的操作系统(Windows 7 ),我登录的所有计算机上的相同用户。

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.

推荐答案

简单:

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

if(pingReply.Status == IPStatus.Success)
{
   //Machine is alive
}

这篇关于如何检查,如果我的网络上的计算机在线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆