C# - How to get properties from a local network cards

By , 11/3/2008
(1 ratings)
How to get properties from a local network cards
Translate to VB
using System.Net.NetworkInformation;

NetworkInterface[] MyInterfaces = NetworkInterface.GetAllNetworkInterfaces();
            
foreach (NetworkInterface Networkcards in MyInterfaces)
{
Console.WriteLine(Networkcards.GetIPProperties().UnicastAddresses);
Console.WriteLine(Networkcards.GetIPProperties().GatewayAddresses);
Console.WriteLine(Networkcards.GetIPProperties().DnsAddresses);
Console.WriteLine(Networkcards.GetIPProperties().DhcpServerAddresses);
Console.WriteLine(Networkcards.GetIPProperties().WinsServersAddresses);
}
Tagged with test, IP, local, Ethernet, Wireless, WLAN, Gateway, DNS, WINS.

Comments

 

Log in, to comment!