您的位置:首页 > 编程语言 > ASP

用文件大小获取单位的函数[asp]

2004-09-20 10:05 411 查看
<%
function cSize(tSize)
if tSize>=1073741824 then
cSize=int((tSize/1073741824)*1000)/1000 & " GB"
elseif tSize>=1048576 then
cSize=int((tSize/1048576)*1000)/1000 & " MB"
elseif tSize>=1024 then
cSize=int((tSize/1024)*1000)/1000 & " KB"
else
cSize=tSize & "B"
end if
end function
%>

例在ASP中用:

<%
response.write cSize(116598)
%>

即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐