VBScript code   —-asp –统计文件夹及其下的所有文件大小

——————————————————————

Function totalsize(size)

If size<1024 Then

totalsize=size&” Bytes”

Elseif size<1048576 Then

totalsize=Round((size/1024),2)&” KB”

Else

totalsize=Round((size/1024/1024),2)&” MB”

End If

End Function

set fs = CreateObject(“Scripting.FileSystemObject”)

Set folder = fs.GetFolder(path)

Response.Write(totalsize(folder.Size) & ” “& vbCrLf)

——————————————————————

asp-totalsize-统计文件大小、文件夹大小

asp-totalsize-统计文件大小、文件夹大小