首 页 网络编程
网页制作 图形图象 操作系统 冲浪宝典
软件教学 认证考试

网络安全 网络办公 行业资讯 评测对比
您当前位置:站长天空 -> 网络编程-> ASP教程
ASP计算文件下载时间-ASP教程,ASP应用
作者:网友供稿 点击:4
推荐
西部数码-全国虚拟主机10强!20余项虚拟主机管理功能,全国领先!第6代双线路虚拟主机,南北访问畅通无阻!可在线rar解压,自动数据恢复设置虚拟目录等.免费赠送访问统计,企业邮局.Cn域名注册10元/年,自助建站480元起,免费试用7天,满意再付款!P4主机租用799元/月.月付免压金
站内搜索
文章页数:[1] 
<%
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>

文章整理:站长天空 网址:http://www.z6688.com/
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

文章页数:[1] 


放大字体显示 缩小字体显示 打印文章 推荐给朋友
热门文章
·在ASP.NET中使用Office Web Components (OWC)创建统计图-.NET教程,数据库应用
·windows系统下jsp+mysql+tomcat的配置-JSP教程,Application/Applet
·把aspx文件编译成DLL文件-.NET教程,Asp.Net开发
·Haneng.com的简单留言板制作源程序例子-ASP教程,ASP应用
·使用VB实现邮箱自动注册(一):表单自动提交-.NET教程,VB.Net语言
·VS.NET安装指南(To菜鸟)-.NET教程,Asp.Net开发
·web下水晶报表的使用!-.NET教程,Web Service开发
·C# 静态成员和方法的学习小结-.NET教程,数据库应用
·IIS的使用-ASP教程,ASP基础
·asp讲座之二:读取通过表单发送的数据
最新文章
·photoshop鼠绘实例:浪漫夏夜壁纸_photoshop教程
·买卖中小网站交易的一些细节问题_站长心得
·七招打造最安全的windows xp操作系统_windows xp
·做google adsense最佳和最重要的要诀_网赚技巧
·上下文关联广告清单(内文广告)推荐_网赚技巧
·广告联盟,痛定思痛_网赚技巧
·insenz首批广告费发放给站长_网赚技巧
·李彦宏:三分之一时间用在寻找人才_站长访谈
·中国汽车资源网杨锁民:网络寒冬时下海_站长访谈
·做it新闻资讯网站应先学新浪_站长心得
相关主题
  • asp计算页面执行时间_asp技巧
  • Asp计算页面执行时间-ASP教程,ASP技巧
  • 西部数码虚拟主机

    友情链接
    CNNIC 西部数码
    万网 自助建站
    虚拟主机 asp空间
    域名注册 域名
    域名申请 主页空间
    论坛空间 网站空间
    国际域名 虚拟空间
    空间租用 DDOS防火墙
    成都主机托管 四川主机托管
    主机租用 服务器租用
    网站目录 自助建站
    虚拟主机 网址大全
    软件下载
    自助链接
    虚拟主机资讯 特价虚拟主机
    版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
    关于我们:站长天空:专业提供最新的站长资讯、在线教程、虚拟主机权威评测、虚拟主机性能对比、网站制作教程,开发教程,站长工具。包括网页制作教程、冲浪宝典、编程参考、操作系统、软件教学、行业动态等。
    特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。
    发表评论 打印  刷新     关闭