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)
{
}
}
}
I am able to get ping time but not able to get download and upload speed.
Please help me out.