If blnAllow=true then ‘只允许上传指定的文件
return = false
for i=0 to UBound(arrExt)
If sFileExt=arrExt(i) then return=true
next
’response.write “Ext: “&sFileExt & ” return: ” & return & ” ”
else ’禁止上传指定的文件
return = true
for i=0 to UBound(arrExt)
If sFileExt=arrExt(i) then return=false
next
End If
CheckFileExt = return
End Function
’*******************************************************
’作 用: 格式化显示文件大小
’FileSize: 文件大小
’*******************************************************
Function FormatSize(FileSize)
If FileSize<1024 then FormatSize = FileSize & ” Byte”
If FileSize/1024 <1024 And FileSize/1024 > 1 then
FileSize = FileSize/1024
FormatSize=round(FileSize*100)/100 & ” KB”
Elseif FileSize/(1024*1024) > 1 Then
FileSize = FileSize/(1024*1024)
FormatSize = round(FileSize*100)/100 & ” MB”
End If
End function
’*******************************************************
’作 用: 取得文件对应的图标
’函数名: FormatSize(FileSize)
’参 数: FileName 文件名
’返回值: 合法文件返回 True ,否则返回False
’*******************************************************
Function GetFileIcon(FileName)

dim FileExt,Fso1
FileExt = GetFileExt(FileName)
ImgPath= strAdminRoot & ”Style/images/file/” & FileExt & “.gif”
Set Fso1 = Server.CreateObject(“Scripting.FileSystemObject”)
If Fso1.fileExists(server.MapPath(ImgPath))=true then
GetFileIcon= “<img src=”"” & ImgPath & “”">”
else
GetFileIcon= “<img src=”"” & strAdminRoot & “Style/images/file/unknow.gif” & “”">”
End If
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-52876-3.html
请不起灯光师