c# - Get connection name and connection IP -


May possibly find connection names and IP connections in IP address .net 2.0.

For example I

Con 1 and its IP is IP 1 Con 2 and its IP IP2

I use this method:

  public dictionary & lt; String, string & gt; GetLocalIP () {dictionary & lt; String, string & gt; _IP = new dictionary & lt; String, string & gt; (); System.Net.IPHostEntry _IPHostEntry = System.Net.Dns.GetHostEntry (System.Net.Dns.GetHostName ()); Foreign currency (System.Net.IPAddress _IPAddress _IPHostEntry.AddressList) {_IP.Add (_IPAddress.AddressFamily.ToString (), _ IPAddress.ToString ()); } Return _IP; }   

But I do not know how I can get a connection name. I should have an attached connection name + connection IP.

If you want to get the "adapter name" for each IP address, then I believe that Net Libraries do not provide this - instead you will need to look at the platform specific P-invoke code.

For some examples of this, some demo projects and open source examples - example

Comments