Hi,
I want to create a ListBox which have list of all the available network in .NET using C# language.....please help
Thank You in Advance...
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant KumarPosted Sep 26, 2011, 2:09 AM
It is a wrapper project with managed code in c# at http://www.codeplex.com/managedwifi
It supports Windows Vista and XP SP2 (or later version).
If it is of the Printer Network please check this link
http://stackoverflow.com/questions/1018001/is-there-a-net-way-to-enumerate-all-available-network-printers
Try this: (For no Active directory)
public static int GetAllIPAndHostNames()
{
string strHostName;
// Getting Ip address of local machine...
// First get the host name of local machine.
strHostName = Dns.GetHostName();
Console.WriteLine("Local Machine's Host Name: " + strHostName);
IPHostEntry remoteIP; //using host name, get the IP address list..
IPHostEntry ipEntry = Dns.GetHostEntry(strHostName);
IPAddress[] addr = ipEntry.AddressList; int i = 0; while (i < addr.Length) { Console.WriteLine("IP Address {0}: {1} ", i, addr[i].ToString()); //HostNames remoteIP = Dns.GetHostEntry((addr[i])); Console.WriteLine("HostName {0}: {1} ", i, remoteIP.HostName); i++; } return 0; }