Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using this code:

strHostName = Dns.GetHostName();
IPHostEntry IpEntry = Dns.GetHostByName(strHostName);
IPAddress[] AddressList = IpEntry.AddressList;

I actually need one IP from this AddressList array (the LAN interface IP only)
Is there any way to know which IP in this array is the LAN interface IP ?


the program should still be working when my PC is connected to a LAN network and to the internet (throw a wireless adapter) at the same time...

waiting for your suggestions...

thanks :)
Posted

1 solution

Refer to this article in CodeProject Finding IP Address Information
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900