Add reference to System.Management
Using system.management ;. . . // Get IP, subnet mask (subnet mask), and default gateway ManagementClass mc = new ManagementClass ( "Win32_NetworkAdapterConfiguration"); ManagementObjectCollection nics = mc.GetInstances (); foreach (ManagementObject nic in nics) {if (Convert.ToBoolean ( NIC ["iPenabled"]) == True) {Console.writeline ((NIC [ipaddress "] as string []) [0]); console.writeline ((NIC [" IPSUBNET "] as string []) [ 0]); console.writeLine ((NIC ["" "" ""] as string []) [0]);}}. . .
If you need other information, please refer to Platform SDK: Windows Management Instrumentation