获取本地网络中的IP地址 [英] Get IPAddresses in local network

查看:141
本文介绍了获取本地网络中的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想获取可从我的PC访问的本地网络中的所有IP地址,也可以说我想要本地域中的所有IP地址.

我想要用C#语言回答.

解决方案

没有人会为您编写代码.

您可以ping子网范围内的每个IP地址(可能需要一段时间!),也可以将自己限制为具有计算机帐户的设备,并向Active Directory查询所有计算机帐户,并从返回的对象中获取其地址. /blockquote>

读取子网掩码并计算您所在的子网掩码中的所有IP地址.然后,您可以使用用户ICMP ping(标准ping)或ARP ping列出所有有效的IP地址. ARP Ping在子网设置中非常可靠.

您可以nmap列出所有主机
nmap -nsP 192.168.10.1/254 | grep ^Host


Hi ,

I want to get all the ip addresses in the local network which is accessible from my pc or you can say i want all the ip addresses in local domain.

I want answers in C# language.

解决方案

Noone is going to write your code for you.

You can either ping every IP address in your subnet range (could take a while!) or you can limit yourself to devices that have a machine account and query Active Directory for all of the computer accounts and get their addresses from the returned objects.


Read the subnet mask and calculate all the IP addresses in the subnet mask you are in. Then you can either user ICMP ping (standard ping) or ARP ping to list all the valid IP addresses. ARP Ping is much reliable in a subnet setting.

You can nmap to list all the hosts
nmap -nsP 192.168.10.1/254 | grep ^Host


这篇关于获取本地网络中的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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