Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to get Internet speed in c#.Net?
Please le ne know if anybody knows. Thanks in advance...
Posted

Here are two articles that describe in details how to improve the ASP.NET application (web application created in C#):
http://www.realsoftwaredevelopment.com/20-tips-to-improve-aspnet-application-performance/[^]
http://www.sitepoint.com/aspnet-performance-tips/[^]
 
Share this answer
 
Comments
Tomas Takac 11-Dec-14 7:08am    
I don't think this is what the OP is after.
Raul Iloc 12-Dec-14 1:11am    
The question was not so clear, and this was my understanding about this question.
You could do it like this.

This example downloads a web page, measures the time needed
and then calculates the speed in bytes per seconds.
C#
Stopwatch stopwatch = new Stopwatch();
            
stopwatch.Reset();
stopwatch.Start();

WebClient webClient = new WebClient();
byte[] bytes = webClient.DownloadData("http://www.codeproject.com");

stopwatch.Stop();

double seconds = stopwatch.Elapsed.TotalSeconds;

double speed = bytes.Count() / seconds;

MessageBox.Show(string.Format("Your speed: {0} bytes per second.", speed));
 
Share this answer
 
v2
Comments
Tomas Takac 11-Dec-14 7:12am    
I think you would need to download a big chunk of data to get meaningfull results.
TheRealSteveJudge 11-Dec-14 7:20am    
Measuring connection speed can only be a sample.
Each time you get a sample it will give different results.
What would you suggest?
 
Share this answer
 

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