首页 >> 读书频道 >> 电脑 >> 计算文件下载时间
 
· 检测整数和长整数的函数
· 一个检测一个字符串在另一
· 用两种不同的方法来求实现
· 检查sql字符串中是否有
· 计算用户在你的页面停留了
· 一个可以管理来访页的程序
· 把存储在SQL7的ima
· 获得字符串的真正长度
· 从数据库 随机 选取一条
· 字符串处理例子 - 获得
· 用ASP显示目录的大小
· 获得文件的最后修改时间
 
· 全唐诗卷四十六
· 韩剧《布拉格恋人》剧情介
· 夜航船[作者:明·张岱]
· 局外人[作者:韩·可爱淘
· 现场流行病学
· 源氏物语[日本:紫式部]
· 红楼梦:120回全本[清
· 武林寓言故事
· 2006高考录取规则
· 首批中国世界名牌产品和2
· 济南美食大全
· 管理三十六计
 
· (出租)中动商场部分及写
· (出租)中动动漫基地&#
· 喜剧学院
· 《善德女王》剧情介绍
· 魔女18号 剧情
· 丑女无敌剧情介绍
· 魔女幼熙剧情介绍
· 龙游天下剧情介绍
· 震撼世界的七日剧情介绍
· 静静的白桦林剧情介绍
· 心情日记—老公今天我想对
· 旗舰剧情介绍
欢迎来到月影社区!如果您觉得这里不错,请推荐给您的朋友们。月影社区:http://wf66.com/

计算文件下载时间


查看有无更新版本

关键字:代码乐园 2006-8-28

 

<%
Function DownloadTime(intFileSize, strModemType)
Dim TimeInSeconds, ModemSpeed, strDownloadTime, AppendString
Dim intYears, intWeeks, intDays
Dim intHours, intMinutes, intSeconds
intYears = 0
intWeeks = 0
intDays = 0
intHours = 0
intMinutes = 0
intSeconds = 0
strDownloadTime = ""
Select Case strModemType
Case "Cable"
 ModemSpeed = 400000
Case "56kbps"
 ModemSpeed = 7000
Case "33.6kbps"
 ModemSpeed = 4200
Case "28.8kbps"
 ModemSpeed = 3600
End Select
TimeInSeconds = int(intFileSize / ModemSpeed)
'year maths added 1/4 of a day. 1 exact orbit of the sub is 365.25 days.
If (Int(TimeInSeconds / 31471200) <> 0) Then intYears = Int(TimeInSeconds / 31449600)
If ((Int(TimeInSeconds / 604800) Mod 52) <> 0) Then intWeeks = Int(TimeInSeconds / 604800) Mod 52
If ((Int(TimeInSeconds / 86400) Mod 7) <> 0) Then intDays = Int(TimeInSeconds / 86400) Mod 7
If TimeInSeconds >= 3600 Then intHours = Int(TimeInSeconds / 3600) Mod 24
If TimeInSeconds >= 60 Then intMinutes = Int(TimeInSeconds / 60) Mod 60
If TimeInSeconds >= 0 Then intSeconds = Int(TimeInSeconds) Mod 60
If intYears <> 0 Then
 If intYears = 1 Then AppendString = "" Else AppendString = "s"
 strDownloadTime = strDownloadTime & intYears & " year" & AppendString & ", "
End If
If intWeeks <> 0 Then
 If intWeeks = 1 Then AppendString = "" Else AppendString = "s"
 strDownloadTime = strDownloadTime & intWeeks & " week" & AppendString & ", "
End If
If intDays <> 0 Then
 If intDays = 1 Then AppendString = "" Else AppendString = "s"
 strDownloadTime = strDownloadTime & intDays & " day" & AppendString & ", "
End If
If intHours <> 0 Then
 If intHours = 1 Then AppendString = "" Else AppendString = "s"
 strDownloadTime = strDownloadTime & intHours & " hour" & AppendString & ", "
End If
If intMinutes <> 0 Then
 If intMinutes = 1 Then AppendString = "" Else AppendString = "s"
 strDownloadTime = strDownloadTime & intMinutes & " minute" & AppendString
End If
If ((intYears = 0) And (intWeeks = 0) And (intDays = 0) And (intHours = 0)) Then
 If intSeconds = 1 Then AppendString = "" Else AppendString = "s"
 If intMinutes > 0 Then
  strDownloadTime = strDownloadTime & ", " & intSeconds & " second" & AppendString
 Else
  strDownloadTime = strDownloadTime & intSeconds & " second" & AppendString
 End If
End If
DownloadTime = strDownloadTime
End Function
%>
<html>
<body>
It is going to take about
<%=DownloadTime(123456,Cable)%> to download this file.
</body>
</html>

计算文件下载时间

[ 1 ]
计算文件下载时间 num

打印本页 关闭

关于我们版权声明本站导航友情连结作品演示 TOP↑