asp下實現(xiàn)格式化文件大小以MB顯示的函數(shù)
更新時間:2007年08月08日 12:02:57 作者:
<%
'******************************
'函數(shù):FormatFileSize(l1)
'參數(shù):l1,字節(jié)數(shù)
'作者:阿里西西
'日期:2007/7/12
'描述:格式化文件大小樣式
'示例:<%=FormatFileSize(l1)%>
'******************************
function FormatFileSize(l1)
dim l2,l3
l3=formatnumber(l1,0,true)
if l1>1048576 then
l2="("&formatnumber(l1/1048576,0,true)&" MB) "&l3
else
if l1>1024 then
l2="("&formatnumber(l1/1024,0,true)&" KB) "&l3
else
l2=formatnumber(l1,0,true)
end if
end if
llI=l2
end function
%>
'******************************
'函數(shù):FormatFileSize(l1)
'參數(shù):l1,字節(jié)數(shù)
'作者:阿里西西
'日期:2007/7/12
'描述:格式化文件大小樣式
'示例:<%=FormatFileSize(l1)%>
'******************************
function FormatFileSize(l1)
dim l2,l3
l3=formatnumber(l1,0,true)
if l1>1048576 then
l2="("&formatnumber(l1/1048576,0,true)&" MB) "&l3
else
if l1>1024 then
l2="("&formatnumber(l1/1024,0,true)&" KB) "&l3
else
l2=formatnumber(l1,0,true)
end if
end if
llI=l2
end function
%>
相關(guān)文章
一個能對訪問者進(jìn)行編號、記錄訪問次數(shù)、IP、時間的統(tǒng)計制作實例
一個能對訪問者進(jìn)行編號、記錄訪問次數(shù)、IP、時間的統(tǒng)計制作實例...2006-12-12asp 讀取通過表單發(fā)送的post數(shù)據(jù)
學(xué)習(xí)ASP,最重要的就是要掌握ASP內(nèi)置的六大對象,如果以前沒接觸過,聰明的您就不要管這些概念了,知道怎么用就行了,我的觀點是剛開始關(guān)鍵在于臨摹2012-12-12