IP Addresses List
-
Hi, We have an application which is almost to work with network IP addresses. A Webpage is need to build which retrieve all the Local Area Network IP addresses of the current domain. Please help me out from this. Ramesh Sambari
-
Hi, We have an application which is almost to work with network IP addresses. A Webpage is need to build which retrieve all the Local Area Network IP addresses of the current domain. Please help me out from this. Ramesh Sambari
Easy!
using System;
using System.Collections.Generic;
using System.Text;
using System.DirectoryServices.ActiveDirectory;namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
System.DirectoryServices.DirectoryEntry entry = new System.DirectoryServices.DirectoryEntry("LDAP://yourdomain");
System.DirectoryServices.DirectorySearcher search = new System.DirectoryServices.DirectorySearcher(entry);
search.Filter = "(objectClass=computer)";foreach (System.DirectoryServices.SearchResult resEntAs in search.FindAll()) { Console.WriteLine(resEntAs.GetDirectoryEntry().Name.ToString()); } Console.ReadLine(); } }
}
Now just request for the IP using System.Net.Dns.GetHostByName() :^)