如何获知并显示文件的大小?
<%Set MyFileSize = Server.CreateObject ("Scripting.FileSystemObject")MyPath = Server.MapPath("/somedirectory")Set MyFolder = MyFileSize.GetFolder(MyPath)%><p><% =MyPath %> is <% =MyFolder.Size %> bytes</p>  ...
<%
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]
很赞哦!()
- 上一篇
asp中在JScript中使用RecordSet对象的GetRows
asp中在JScript中使用RecordSet对象的GetRows
- 下一篇
浅析Java、C/C++、JavaScript、PHP、Python分别用来开发什么?
<%Set MyFileSize = Server.CreateObject ("Scripting.FileSystemObject")MyPath = Server.MapPath("/somedirectory")Set MyFolder = MyFileSize.GetFolder(MyPath)%><p><% =MyPath %> is <% =MyFolder.Size %> bytes</p>  ...
大图广告(830*140)