Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

C#
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)
        {
            

        }
    }
}

I am able to get ping time but not able to get download and upload speed.
Please help me out.
Posted
Updated 4-Dec-16 22:37pm
v4

1 solution

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.
 
Share this answer
 
Comments
DaveAuld 4-Dec-16 8:52am    
Well said!
Adityakumar2318 5-Dec-16 1:13am    
Thanks, but i am making a speed test software in winodws application using C#.

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