• ----:)欢迎访问源码网(:----
    • 首页
    • 博客
    • 学院
    • 下载
    • 论坛
    • 影视
    • 发布源码
    • RSS
    • ITPig
    • 笑话网
    • 百家姓
    • 繁體中文

源码网 - 中国第一源码门户
选择镜像:网通镜像 - 电信主站
  • 首 页
  • 新闻动态
  • 网站运营
  • 网页制作
  • WEB开发
  • 编程开发
  • 图像媒体
  • 操作系统
  • 数据库
  • 服务器
热门搜索 优化 SEO 故事 cms IIS7 MySQL 个人 AdSense 主题推广 | 文章搜索: 高级搜索
会员登录/控制面版您的位置: 学院首页 >> WEB开发 >> ASP开发 >> ASP技巧 >> 详细内容
 

推荐文章

 
 

热点文章

  • ASP采集教程基础篇
  • ASP+JS三级联动下拉菜单[调用数据库数据]
  • 根据IP地址自动判断转向分站的代码
  • 如何使ASP程序暂停指定的时间后再继续执行
  • 防止网上重复投票的方法
  • 精华ASP代码
  • WEB打印大全
  • 同一个空间不同的域名实现访问不同的文件夹
  • 小偷程序原理和简单示例
  • Asp限制IP访问
  • 实现页面重定向
  • ASP自动解压RAR文件
 
 

相关文章

  • 检测浏览器是否支持有Flash2.0以上或有Flash插件
  • 用HTML META标签和ASP来作定时迟时信息
  • 怎样计算折扣
  • 动态输入框的三个函数
  • 检测表单输入EMAIL的合法性
  • 多域名同一空间的处理实例
  • Asp限制IP访问
  • 检测整数和长整数的函数
  • 如何使ASP程序暂停指定的时间后再继续执行
  • 使用ASP和Word进行服务器端拼写检查
  • 用ASP在ACCESS中插入图片怎么表示?
  • 生成一个不重复的随即数字
 
 

百度搜索

 
 

计算文件下载时间

  • 阅览次数:
  • 文章来源: 网海之贝
  • 原文作者: 佚名
  • 整理日期: 2006-10-03
  • 发表评论
  • 字体大小:
  • 小
  • 中
  • 大

<%
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>
       

上一篇:MySQL数据库的导入导出 和 Liunx的权限
下一篇:构建支持Master/Slave读写分离的数据库操作类
  • 网友评论:
  • 查看所有评论
  • 我要发表评论
您的网名:
留言主题:
你要发表的内容:

 

关于本站 | 广告联系 | 版权声明 | 网站地图 | 发布软件 | 帮助中心 | 源码论坛

Copyright © 2005-2007 CodePub.Com  程序支持:木翼  滇ICP备05005971号