本文介绍了问题C#Internet Speed Tester帮助...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在制作简单的网络速度测试仪软件..就像www.speedtest.net
我可以轻松地使用Webclient下载方法检查下载速度..
LIke ..
Hi,
I am making simple internet Speed Tester software..Like www.speedtest.net
I can easily manage to check download speed with the Webclient download method..
LIke..
private void glassButton1_Click(object sender, EventArgs e)
{
Uri URL = new Uri("http://sixhoej.net/speedtest/1024kb.txt");
WebClient wc = new WebClient();
startTime = Environment.TickCount;
wc.DownloadFileAsync(URL, @"D:\speedtest.txt");
wc.DownloadFileCompleted += new AsyncCompletedEventHandler(Download_complete);
}
private void Download_complete(object sender, EventArgs e)
{
double endTime = Environment.TickCount;
double sec = Math.Floor(endTime - startTime) / 1000;
double kb = Math.Round(1024 / sec);
double mb = kb / 100;
label1.Text = mb.ToString() + " " + "Mb/Sec";
analogMeter1.Value = (float) mb;
try
{
// delete downloaded file
System.IO.File.Delete(@"D:\speedtest.txt");
}
catch
{
;
}
}
我也想检查上传速度..但是我知道怎么做这个与webclient ..我需要帮助..任何人都可以发布一些webclient上传的例子..
预付谢谢...
I also want to check Upload speed ..But i dun knw how to done this with webclient.. I need help.. can anyone post some example of webclient upload ..
Advance Thanks...
推荐答案
这篇关于问题C#Internet Speed Tester帮助...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!