Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to get bandwidth of a single ip address bandwidth from a lan?here first i have to get all IP address from a lan and then when i select a single IP address i should get its bandwidth...
Posted

1 solution

I think you are looking for the
System.Net.NetworkInformation.NetworkInterface

You can get all the adapters on your system by using
NetworkInterface.GetAllNetworkInterfaces()
. From every adapter you can request the Speed.

If you need to know it from a specific IP Address you can use something like:

foreach (NetworkInterface networkInterface in NetworkInterface.GetAllNetworkInterfaces())
{
   if (networkInterface.OperationalStatus == OperationalStatus.Up)
   {
      foreach (UnicastIPAddressInformation unicastIPAddressInformation in     
                  networkInterface.GetIPProperties().UnicastAddresses)
      {
         if ((null != unicastIPAddressInformation.IPv4Mask) &&
             (unicastIPAddressInformation.Address.AddressFamily ==
               AddressFamily.InterNetwork))
         {
             IPAddress theAddress = unicastIPAddressInformation.Address;
             IPAddress theMask = unicastIPAddressInformation.IPv4Mask;
         }
      }
   }
}
 
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