网络编程
位置:首页>> 网络编程>> Asp编程>> Asp测试网速代码(带进度条)

Asp测试网速代码(带进度条)

作者:海娃 来源:51windows.net 发布时间:2007-11-12 13:09:00 

标签:网速,测试,asp

代码如下,另存为asp文件,请传到你的服务器上就可以了

马上测一下


<%
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%><html>
<head>
<title>asp网速测试</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<body style="cursor:wait;">
<p style="font-size:18pt;"><B>网速测试</B></p>
<p id="t" style="font-size:16pt;">正在测试,请稍候...</p>
<span style="width:300;height:16px;background-color:gray;"><span id="p" style="width:0;height:16px;background-color:red;"></span></span>
<script language="javascript">st = new Date();function $(p){document.getElementById("t").innerHTML="正在测试,请稍候...("+p+"%)";document.getElementById("p").style.width=p*3;}</script>
<%
defaultfs = 200 '数据默认大小(K)
minfs = 100 '数据最小值
maxfs = 500 '数据最高值
fs = Request("s")
if len(fs) = 0 or isnumeric(fs) = false then fs = defaultfs
if int(fs) > maxfs then fs = maxfs
if int(fs) < minfs then fs = minfs
for a=1 to fs%><!--$%^)!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()!@#$%^&*()--><script language=javascript>$(<%=int(a*100/fs)%>)</script><%next%>
<script language=javascript>
et=new Date();ds=<%=fs%>;s=Math.round(ds*1000/(et-st)*10)/10;document.body.style.cursor='default';
nextsize=<%=fs%>;if(s>100){nextsize=<%=maxfs%>;}else if(s<20){nextsize=<%=minfs%>;}
document.getElementById("t").innerHTML="测试完毕。您的速度:<font color='red'>"+s+"</font>(K/秒) [<a href='?s="+nextsize+"&t="+Math.random()+"'>重测</a>]";</script>
</body>
</html>


0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com