如何创建应用程序以检查LAN PC的连接? [英] How do I creates a application to check connectivity of a LAN PC?

查看:70
本文介绍了如何创建应用程序以检查LAN PC的连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建程序以确定计算机(例如,具有ip 192.168.1.5的Computer1)是否从另一台计算机连接到LAN(例如,带有IP 192.168.1.2的服务器)?



我尝试了什么:



i还没有尝试任何东西,因为我不知道从哪里开始,我使用vmware环境有两个Windows 7计算机,一个充当服务器,另一个是客户端计算机。

HOW to create a program to determine if a computer (E.g. Computer1 with ip 192.168.1.5) is connected to the LAN from another computer (E.g Server with ip 192.168.1.2) ?

What I have tried:

i haven't tried any thing yet because i have no idea where to start, im using a vmware environment with two windows 7 computers, one is act as a server other is a client computer.

推荐答案

尝试建立与运行的服务的连接另一个系统或使用 Ping Class(系统。 Net.NetworkInformation) [ ^ ]。



请注意,当防火墙过滤掉这两种方法时可能无效。



使用Windows,您也可以使用< a href =https://technet.microsoft.com/de-de/library/bb490719.aspx>网络视图 [ ^ ]命令。如果没有任何选项,它将显示当前域中的计算机列表。但执行通常需要一些时间,您必须解析系统名称以获取IP。
Try to establish a connection to a service running on the other system or use the Ping Class (System.Net.NetworkInformation)[^].

Note that both methods may not work when filtered out by firewalls.

With Windows you can also use the Net view[^] command. Without any options it will display a list of computers in your current domain. But execution requires usually some time and you have to resolve the system names to get the IPs.


这篇关于如何创建应用程序以检查LAN PC的连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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