|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
由于ASP提供的是一对多的服务,所以用户的一些特殊需求很难得到满足。下载ASP怎样盘算文件下载必要的工夫
<%
FunctionDownloadTime(intFileSize,strModemType)
DimTimeInSeconds,ModemSpeed,strDownloadTime,AppendString
DimintYears,intWeeks,intDays
DimintHours,intMinutes,intSeconds
intYears=0
intWeeks=0
intDays=0
intHours=0
intMinutes=0
intSeconds=0
strDownloadTime=""
SelectCasestrModemType
Case"Cable"
ModemSpeed=400000
Case"56kbps"
ModemSpeed=7000
Case"33.6kbps"
ModemSpeed=4200
Case"28.8kbps"
ModemSpeed=3600
EndSelect
TimeInSeconds=int(intFileSize/ModemSpeed)
yearmathsadded1/4ofaday.1exactorbitofthesubis365.25days.
If(Int(TimeInSeconds/31471200)0)ThenintYears=Int(TimeInSeconds/31449600)
If((Int(TimeInSeconds/604800)Mod52)0)ThenintWeeks=Int(TimeInSeconds/604800)Mod52
If((Int(TimeInSeconds/86400)Mod7)0)ThenintDays=Int(TimeInSeconds/86400)Mod7
IfTimeInSeconds>=3600ThenintHours=Int(TimeInSeconds/3600)Mod24
IfTimeInSeconds>=60ThenintMinutes=Int(TimeInSeconds/60)Mod60
IfTimeInSeconds>=0ThenintSeconds=Int(TimeInSeconds)Mod60
IfintYears0Then
IfintYears=1ThenAppendString=""ElseAppendString="s"
strDownloadTime=strDownloadTime&intYears&"year"&AppendString&","
EndIf
IfintWeeks0Then
IfintWeeks=1ThenAppendString=""ElseAppendString="s"
strDownloadTime=strDownloadTime&intWeeks&"week"&AppendString&","
EndIf
IfintDays0Then
IfintDays=1ThenAppendString=""ElseAppendString="s"
strDownloadTime=strDownloadTime&intDays&"day"&AppendString&","
EndIf
IfintHours0Then
IfintHours=1ThenAppendString=""ElseAppendString="s"
strDownloadTime=strDownloadTime&intHours&"hour"&AppendString&","
EndIf
IfintMinutes0Then
IfintMinutes=1ThenAppendString=""ElseAppendString="s"
strDownloadTime=strDownloadTime&intMinutes&"minute"&AppendString
EndIf
If((intYears=0)And(intWeeks=0)And(intDays=0)And(intHours=0))Then
IfintSeconds=1ThenAppendString=""ElseAppendString="s"
IfintMinutes>0Then
strDownloadTime=strDownloadTime&","&intSeconds&"second"&AppendString
Else
strDownloadTime=strDownloadTime&intSeconds&"second"&AppendString
EndIf
EndIf
DownloadTime=strDownloadTime
EndFunction
%>
<html>
<body>
Itisgoingtotakeabout
<%=DownloadTime(123456,Cable)%>todownloadthisfile.
</body>
</html>
楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。 |
|