S
Sudip_inn
Guest
when i am testing below code which is showing my VMWare IP address but how to get my either net card IP address.
public static string GetIPAddress()
{
var host = Dns.GetHostEntry(Dns.GetHostName());
foreach (var ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
return ip.ToString();
}
}
throw new Exception("No network adapters with an IPv4 address in the system!");
}
how to fetch either net card or my network lan card IP address by c#. thanks
Continue reading...
public static string GetIPAddress()
{
var host = Dns.GetHostEntry(Dns.GetHostName());
foreach (var ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
return ip.ToString();
}
}
throw new Exception("No network adapters with an IPv4 address in the system!");
}
how to fetch either net card or my network lan card IP address by c#. thanks
Continue reading...