473,385 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

internet speed


I want to detect the internet speed using C# to show the user on what speed
he's connecting to internet?

Jul 12 '07 #1
6 6218
That is usually written in the ISP's monthly bill.

--
Sheng Jiang
Microsoft MVP in VC++
"Jassim Rahma" <jr****@hotmail.comwrote in message
news:E4**********************************@microsof t.com...
>
I want to detect the internet speed using C# to show the user on what
speed
he's connecting to internet?

Jul 12 '07 #2
On Fri, 13 Jul 2007 12:36:49 -0700, Jassim Rahma <jr****@hotmail.com>
wrote:
well, if you connect to internet, move the cursor to the icon on the
system tray and you will see that you are connect with 64K or 32K or
120K or whatever, that's what I want to get calculated..
If you are using a dial-up adapter, it is true that many of the modem
drivers will report their actual connect speed. Similarly, a wireless
network drive _may_ report it's current connect speed.

But this information isn't useful generally, because only certain devices
report the speed that the device is actually connected at (for example,
some wireless adapters always look like 10Mbps devices, or 54Mbps devices,
or some other default value), _and_ in addition the speed that the device
is aware of may not be the actual Internet connection speed anyway (so
even if the device always reported as accurate information as it has, that
still won't tell you what you say you want to know).

As I wrote before: the only thing you can do to reliably know the
information you say you want to know is to measure it directly.

Pete
Jul 13 '07 #3

the problem here is that the ISP is always promising the highest speend when
the delivered speed is not even to the half, that's why they provided a
website to show the user what is thier current internet speed at:

http://www.inetsupport.com.bh/meter/

and i just need to do the same using C#..

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Fri, 13 Jul 2007 12:36:49 -0700, Jassim Rahma <jr****@hotmail.com>
wrote:
>well, if you connect to internet, move the cursor to the icon on the
system tray and you will see that you are connect with 64K or 32K or
120K or whatever, that's what I want to get calculated..

If you are using a dial-up adapter, it is true that many of the modem
drivers will report their actual connect speed. Similarly, a wireless
network drive _may_ report it's current connect speed.

But this information isn't useful generally, because only certain devices
report the speed that the device is actually connected at (for example,
some wireless adapters always look like 10Mbps devices, or 54Mbps devices,
or some other default value), _and_ in addition the speed that the device
is aware of may not be the actual Internet connection speed anyway (so
even if the device always reported as accurate information as it has, that
still won't tell you what you say you want to know).

As I wrote before: the only thing you can do to reliably know the
information you say you want to know is to measure it directly.

Pete
Jul 13 '07 #4
On Fri, 13 Jul 2007 13:25:03 -0700, Jassim Rahma <jr****@hotmail.com>
wrote:
the problem here is that the ISP is always promising the highest speend
when the delivered speed is not even to the half, that's why they
provided a website to show the user what is thier current internet speed
at:

http://www.inetsupport.com.bh/meter/

and i just need to do the same using C#..
So what part of my previous answer are you having difficulty understanding?
Jul 13 '07 #5
Jassim Rahma wrote:
the problem here is that the ISP is always promising the highest speend
when the delivered speed is not even to the half, that's why they
provided a website to show the user what is thier current internet speed
at:

http://www.inetsupport.com.bh/meter/

and i just need to do the same using C#..
Try with some code like:

using System;
using System.Net;

namespace E
{
public class MainClass
{
public static double Speed(string url)
{
WebClient wc = new WebClient();
DateTime dt1 = DateTime.Now;
byte[] data = wc.DownloadData(url);
DateTime dt2 = DateTime.Now;
return (data.Length * 8) / (dt2 - dt1).TotalSeconds;
}
public static void Main(string[] args)
{
Console.WriteLine("speed to somewhere in Bahrain = " +
Speed("http://www.inetsupport.com.bh/meter/initialmeter.php")/1000 + "
Kbit/s");
Console.ReadLine();
}
}
}

It is obvious that you can not get a speed that are faster than your
internet connection.

But it is also obvious that you can get a speed that is much lower than
your internet connection, if the bottleneck between you and the server
are not your internet connection.

The program above gives a speed about 1/25 of my actual internet speed.
But then I am also a bit away from Bahrain, so I am not surprised.

Arne
Jul 15 '07 #6
If you are not connected via router (in which case the router should be
able to tell you what you want to know), you can try DUMeter from here:
http://www.dumeter.com/

Regards,
Nicolas

*** Sent via Developersdex http://www.developersdex.com ***
Jul 16 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Yang Li Ke | last post by:
Hi guys, Is it possible to know the internet speed of the visitors with php? Thanx -- Yang
2
by: Abubakar | last post by:
Hi, I have a small sockets application and I'm adding a feature in it to transfer files. Since I also want to give it a transfer resume feature so this means I'll be transfering in specific bytes...
19
by: Mark 123 | last post by:
I just read at http://groups.google.com/group/microsoft.public.access.forms/browse_frm/thread/766ba7b493eacb63/8a7d5504ee848c21?lnk=st&q=migrate+access+97+to+access+2007&rnum=1#8a7d5504ee848c21...
2
by: shalin123 | last post by:
The problem is with the Internet speed in our house. we have a 10 Mbps connection which is used by around 10 people. When anyone used to download stuff using torrents the internet speed used to...
4
by: OgaW | last post by:
Hey somebody, Is there any way to increase internet speed at 512kbps for download, 256 for upload other than pay ISP more money or adding more memory? Like change certain registry setting or...
3
by: mayflower | last post by:
Hi guys, Please help me in retrieving(CODE)for the bandwidth speed of internet connection in Asp.net(Csharp code). Thank you, Kranthikiran
2
by: pavanip | last post by:
Hi, I have an application like Optimize System Performance by using Memory speed, cpu speed and Disk speed. How to optimize memory speed,disk optimization and CPU optimization. Please provide me...
15
by: ingejg | last post by:
I am starting to study internet synchronization, and my head is still spinning since internet is not my forte, however my boss is breathing down my neck at the moment. Our company has only one...
4
by: nestle | last post by:
I have DSL with a download speed of 32MB/s and an upload speed of 8MB/s(according to my ISP), and I am using a router. My upload speed is always between 8MB/s and 9MB/s(which is above the max upload...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.