站长资源网络编程
如何获知并显示文件的大小?
简介<%Set MyFileSize = Server.CreateObject ("Scripting.FileSystemObject")MyPath = Server.MapPath("/somedirectory")Set MyFolder = MyFileSize.GetFolder(MyPa
<%
Set MyFileSize = Server.CreateObject ("Scripting.FileSystemObject")
MyPath = Server.MapPath("/somedirectory")
Set MyFolder = MyFileSize.GetFolder(MyPath)
%>
<p><% =MyPath %> is <% =MyFolder.Size %> bytes</p>
我们可以看到显示的样式如:Shenzhaoyang\Chunfeng\somedirectory is 66093625 bytes。
[1]
上一篇:如何获知文件被改动的情况?
下一篇:如何获取文件的名称和扩展名?