?? uploadbar.asp
字號:
<%@EnableSessionState=False%>
<%
Response.CacheControl = "no-cache"
Response.Expires = -1
Dim Per
Per=Application("UpPercent")
%>
<html>
<head>
<meta http-equiv=refresh content="1">
<title>上傳進度</title>
<style>
td,body {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:9pt;
}
</style>
</head>
<body bgcolor="buttonface" style="margin:10px;">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td bgcolor="buttonface">
<table ID="Prog" border="0" width="<%=Per%>%" bgcolor="#336699">
<tr>
<td width="100%" height="30" align="center"><font color="white"><b><%=Per%>%</b></font></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<%
Select Case Per
Case 0:Response.Write "正在準備..."
Case 100
Response.Write "上傳百分比:"&Per&"%,上傳完畢!"
If UCase(Request("b"))="NN" Then Response.Write "<script language=""javascript"">window.close();</script>"
Case Else
Dim tGone,bRead,fLeft
fLeft=-1
tGone=FormatNumber(Timer()-Application("UpStart"),0)
bRead=Application("ReadBytes")/1024
If bRead>0 Then fLeft=(Application("TotalBytes")-Application("ReadBytes"))*tGone/Application("ReadBytes")
Response.Write FormatSize(bRead,true)&"/"&FormatSize(Application("TotalBytes")/1024,true)&"("&CStr(Per)&"%),耗時: "&FormatSec(tGone)&",速度: "&FormatSize(bRead/tGone,false)&"/S"
If fLeft<>-1 Then
Response.Write ",剩余時間:"&FormatSec(fLeft)
Else
Response.Write ",剩余時間:正在估計..."
End If
End Select
%>
<br>您可以按瀏覽器的 <font color="red"><b>停止</b></font> 按鈕來停止上傳!
</body>
</html>
<%
Function FormatSec(intV)
Dim iHour,iMinute,iSec,t
intV=ABS(intV)
If intV=0 Then FormatSec="00:00":Exit Function
If intV>=3600 Then
iHour=Fix(intV/3600)
t=intV mod 3600
If t>=60 Then
iMinute=Fix(t/60)
iSec=t mod 60
Else
iMinute=0
iSec=t
End If
ElseIf intV>=60 Then
iHour=0
iMinute=Fix(intV/60)
iSec=intV mod 60
Else
iHour=0
iMinute=0
iSec=intV
End if
If iHour<>0 Then FormatSec=CStr(iHour)&":"
FormatSec=FormatSec&Right("0"&CStr(iMinute),2)&":"
FormatSec=FormatSec&Right("0"&CStr(iSec),2)
End Function
Function FormatSize(fv,isK)
If isK Then fv=fv*1024
If fv>=1024000 Then
FormatSize=CStr(Round(fv/1024000,1))&"M"
ElseIf fv>=1000 Then
FormatSize=CStr(Round(fv/1024,1))&"K"
Else
FormatSize=CStr(fv)&"B"
End If
End Function
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -