Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to find all Network Interfaces for a given ip address.

Right now,I am using below code to determine it but it is always giving it for local computer and I want to achieve it for given IP address.
F#
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in adapters)
{

    IPInterfaceProperties adapterProperties = adapter.GetIPProperties();
    IPAddressCollection dnsServers = adapterProperties.DnsAddresses;
    if (dnsServers.Count > 0)
    {
        
        Console.WriteLine("Adapter Id .... : " + adapter.Id);
        Console.WriteLine("Adapter Description .... : " + adapter.Description);
        Console.WriteLine("Adapter Name .... : " + adapter.Name);
Console.WriteLine("Network Interface Type .... : " + adapter.NetworkInterfaceType.ToString());
        Console.WriteLine("Adapter Speed .... : " + adapter.Speed);
        Console.WriteLine("OperationalStatus .... : " + adapter.OperationalStatus);
        Console.WriteLine("Adapter SupportsMulticast .... : " + adapter.SupportsMulticast);
        
        }
    }

please suggest..........
Posted
Updated 1-Jul-14 21:08pm
v2
Comments
johannesnestler 2-Jul-14 15:04pm    
so the question is how to get Network Interface information for a remote computer given by it's IP? I'm not shure but my first guess is you'll need WMI for that.

1 solution

 
Share this answer
 
Comments
Ajit9887522644 2-Jul-14 5:00am    
this links gives the same solution which i have posted with my question. It works only for local computer not for remote location.

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