程序代码:
<%
Set MyFileSize = Server.CreateObject ("Scripting.FileSystemObject")
MyPath = Server.MapPath("/Web")
Set MyFolder = MyFileSize.GetFolder(MyPath)
%>
<p><% =MyPath %> is <% =MyFolder.Size %> bytes</p>
显示结果为:
:\Inetpub\wwwroot\Web is 47331 bytes