Code to get the all ip information from the machine. like ipaddress ip address wireless how to fix this?
I have multiple adapters on my machine. Fetching the ip address with below code is just giving me the array of IP addresses but I need adapter names also corresponding to them so that I can filter them and diplay only particular adapters on my final report.
private void Form1_Load(object sender, EventArgs e)
{
var host = Dns.GetHostEntry(Dns.GetHostName());
foreach (var ip in host.AddressList)
{
Console.WriteLine("IP Address = " + ip.ToString());
label5.Text += (" " + ip);
label6.Text += (" " + ip);
}
}