.Net中扫描局域网IP列表的几种方法(binsweet@gmail.com)
很多软件都有获知局域网在线计算机IP的功能,但是在.net怎么实现呢,有好多方法,
下面我给大家介绍几种,供大家参考。
1、微软社区上介绍了使用Active Directory 来遍历局域网
利用DirectoryEntry组件来查看网络
网址:http://www.microsoft.com/china/community/program/originalarticles/techdoc/DirectoryEntry.mspx
private
void
EnumComputers()
{
using (DirectoryEntry root = new DirectoryEntry( " WinNT: " ))
{
foreach (DirectoryEntry domain in root.Children)
{
Console.WriteLine( " Domain | WorkGroup: "
{
using (DirectoryEntry root = new DirectoryEntry( " WinNT: " ))
{
foreach (DirectoryEntry domain in root.Children)
{
Console.WriteLine( " Domain | WorkGroup: "