局域网中的单个IP带宽 [英] single ip bandwidth from a lan
本文介绍了局域网中的单个IP带宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从局域网获取单个IP地址带宽的带宽?在这里,我首先必须从局域网获取所有IP地址,然后当我选择单个IP地址时,我应该获取其带宽...
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...
推荐答案
我认为您正在寻找
System.Net.NetworkInformation.NetworkInterface
您可以使用
You can get all the adapters on your system by using
NetworkInterface.GetAllNetworkInterfaces()
获取系统上的所有适配器.您可以从每个适配器请求速度.
如果您需要从特定的IP地址了解它,可以使用类似以下内容的内容:
. 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;
}
}
}
}
这篇关于局域网中的单个IP带宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文