如何计算speedtest.net等任何服务器的下载和上传速度? [英] How to calculate download and upload speed of any server like speedtest.net?

查看:151
本文介绍了如何计算speedtest.net等任何服务器的下载和上传速度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何计算speedtest.net等任何服务器的下载和上传速度?



我想计算下载和上传速度,如www.google.com但是我不想下载和上传任何文件。



我想构建类似speedtest.net的应用程序,如下所示。

下面是Uuser界面(UI)

服务器名称:www.google.com - 组合框(选择服务器的选项)

Ping:7ms - 标签(用于显示速度)

下载速度:4Mbps - 标签

上传速度:2 Mbps - 标签



开始测试 - 按钮(点击后,结果将显示)



我的尝试:



How to calculate download and upload speed of any server like speedtest.net?

I want to calculate download and upload speed like www.google.com but i dont want to download and upload any file.

I want to build the application like speedtest.net like below.
Below is the Uuser Interface(UI)
Server Name: www.google.com -- Combo box(option to select server)
Ping: 7ms -- label(Used to display the speed)
Download Speed: 4Mbps -- label
Upload Speed: 2 Mbps -- label

Start test -- Button(After clicking, result will display)

What I have tried:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Net;
using System.Net.NetworkInformation;

namespace InternetSpeedTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string str= comboBox1.SelectedItem.ToString();


            lblPing.Text = new Ping().Send(str).RoundtripTime.ToString() +  "MS";
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            comboBox1.Items.Add("www.yahoo.com");
            comboBox1.Items.Add("www.google.com");
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            

        }
    }
}



我能够获得ping时间但无法获得下载和上传速度。

请帮帮我。


I am able to get ping time but not able to get download and upload speed.
Please help me out.

推荐答案

0)ping值与上传或下载速度无关。



1)上传/下载速度涉及计算机和服务器之间进行速度测试的整个路径。



2)进行速度测试涉及在两个方向上传输大得多的文件,并且通常涉及Web服务器,这意味着您必须编写一个可以接受启动该过程的Web请求的网站(制作您的winforms应用程序)无意义)。



3)鉴于互联网的性质,包括(但不限于)遍历的节点数量,涉及的路由器和交换机的速度,以及从您的ISP管道到您自己的调制解调器,以及您拥有的网卡类型,无论您是否使用有线或无线连接,甚至一天中的什么时间,速度测试基本没有意义,并没有提供任何帮助基于任何可靠的估计实际上/下速度的度量。
0) The ping value is in no way related to upload or download speed.

1) Upload/download speed involves the entire route between your computer and the server the speed test is conducted with.

2) Conducting speed tests involves transferring a substantially large file in both directions, and usually involves a web server, meaning you have to write a web site that can accept the web requests that initiate the process (making your winforms app pointless).

3) Given the nature of the internet, including (but not limited to) the number of nodes traversed, speed of the routers and switches involved, the size of the pipe from your ISP to your own modem, and the type of network card you have, whether or not you're using a wired or wireless connection, and even what time of the day it is, speed tests are essentially pointless and provide no useful metric on which to base any kind of reliable estimation of actual up/down speed.


这篇关于如何计算speedtest.net等任何服务器的下载和上传速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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