查找连接速度 [英] Find Speed of Connection

查看:51
本文介绍了查找连接速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想找出我的连接速度(当前为100 mbps).

Hello,

I want to find out speed of my connection(currently it is 100 mbps)

推荐答案

在此处查看此MSDN示例:http://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkinterface.speed.aspx [ ^ ]:
See this MSDN example here: http://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkinterface.speed.aspx[^]:
public static void EnumerateInterfaceDescriptionAndSpeed()
{
    NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
    foreach (NetworkInterface adapter in adapters)
    {
        IPInterfaceProperties properties = adapter.GetIPProperties();
        IPv4InterfaceStatistics stats = adapter.GetIPv4Statistics();
        String description = adapter.Description;
        long   speed = adapter.Speed;
        // Do something here to show this stuff in your GUI
        // or store it into some structure or an fitting object
    }
}


这篇关于查找连接速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆