I\'m trying to build some complicated stuff for an C# winform application being build online and trying to gather some information here and there.I\'ve looked on the web tha
As the other responses suggest, getting the IP address may not do what you need. What are you trying to use this information for?
You might want to try and use the System.Management.ManagementObjectSearcher object to query for this kind of info. I know this can be used to grab the MAC address of each connected network adaptor. This logic would have to be on the client side that could then pass whatever info you needed up to the server.
It looks like this Google Groups post might do what you are after. Here is the interesting bit:
using System.Management;
ObjectQuery query = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration");
ManagementObjectCollection queryCollection = query.Get();
foreach( ManagementObject mo in queryCollection )
{
foreach(string s in addresses)
{
Console.WriteLine( "IP Address ‘{0}’", s);
}
foreach(string s in subnets)
{
Console.WriteLine( "IP Subnet ‘{0}’", s);
}
}