很多软件都有获知局域网在线计算机IP的功能,但是在.net怎么实现呢,有好多方法, 下面我给大家介绍几种,供大家参考。

1、微软社区上介绍了使用Active Directory 来遍历局域网 利用DirectoryEntry组件来查看网络 网址:http://www.microsoft.com/china/communITy/program/originalarticles/techdoc/DirectoryEntry.mspx

 1 private void EnumComputers()
 2   {
 3     using(DirectoryEntry root = new DirectoryEntry("WinNT:"))
 4     {
 5       foreach(DirectoryEntry domain in root.Children)
 6       {
 7         Console.WriteLine("Domain | WorkGroup: "+domain.Name);
 8         foreach(DirectoryEntry computer in domain.Children)
 9     {
10      Console.WriteLine("Computer: "+computer.Name);
11     }
12    }
13   }
14  }
View Code

相关文章:

  • 2022-12-23
  • 2022-12-28
  • 2022-12-23
  • 2021-06-10
  • 2021-05-15
  • 2021-12-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案