By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,991 Members | 1,888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,991 IT Pros & Developers. It's quick & easy.

internet speed

P: n/a

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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a

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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.