列出连接到一个局域网中所有计算机的IP地址 [英] List the IP Address of all computers connected to a single LAN

查看:209
本文介绍了列出连接到一个局域网中所有计算机的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写,你连接,由于种种原因,到其他计算机在局域网的程序。然而,而不必输入IP地址为多台计算机(在一个痛苦的对接),我不知道是否有一种方法可以列出一个局域网内所有计算机的IP地址。我研究了一整天,为的是尚未找到什么合适的。这是因为没有这样的存在? 谢谢你在前进。

I am writing a program where you connect, for various reasons, to other computers in a LAN. However, rather than having to input the IP address for multiple computers (a pain in the butt), I was wondering if there is a way to list the IP addresses of all the computers in a LAN. I have researched all day, and as of yet have found nothing suitable. Is this because nothing of this sort exists? Thank you in advance.

编辑:这似乎与许多意见这个帖子不饶人,我应该张贴我的实际解决方案。一般来说,命名约定的计算机的IP地址在LAN上是相同的。例子是192.168.2。*,*替换为任何有效的数字。我的程序检测到IP地址,它显示给用户,然后请求IP的第一个3个街区。然后,它按顺序扫描高达200在给定的IP命名约定通过ping并等待响应。没有反应,没有电脑。它可以做一切你可以用一个IP做一次,它知道它有一台电脑后面。

It would seem that with the many views this post is getting, I should post my actual solution. In general, the naming conventions for computers IP addresses on a LAN are the same. example being 192.168.2.*, * being replaced with any valid number. My program detects the IP address, displays it to the user, then asks for the first 3 blocks of IP. It then sequentially scans up to 200 in the given IP naming convention by pinging and waiting for a response. No response, no computer. It can do everything you can do with an IP once it knows it has a computer behind it.

推荐答案

你不是真的要找到任何更可靠的比 ING或的arping 荷兰国际集团在同一子集的地址。我在这一天实现了这个有一定的软件回到我的第一次实习和,我最后一次检查(是公平的那是几年前),这是他们仍然使用这个功能是什么。我认为这意味着他们还没有找到更好的东西。

You're not really going to find anything more reliable than pinging or arpinging addresses on the same subset. I implemented this for a certain piece of software back in the day on my first internship and, last time I checked (to be fair it was several years ago), that is what they were still using for this functionality. I take that to mean that they haven't found anything better.

这是不难找到源头code,这些并把它们转化为C#。 ,的 的arping 。或者,你只要掏出一个命令提示符并执行,然后分析结果。

It is not hard to find the source code for these and translate them to C#. ping, arping. Alternatively, you just shell out to a command prompt and execute ping and then parse the results.

这篇关于列出连接到一个局域网中所有计算机的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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