ASP Size 屬性
asp size 屬性

size 屬性用于返回指定文件或文件夾的字節(jié)數(shù)。
語(yǔ)法
fileobject.size
folderobject.size
folderobject.size
針對(duì) file 對(duì)象的實(shí)例
<%
dim fs,f
set fs=server.createobject("scripting.filesystemobject")
set f=fs.getfile("c:\test.asp")
response.write("the size of test.asp is: ")
response.write(f.size & " bytes.")
set f=nothing
set fs=nothing
%>
輸出:
the size of test.asp is: 10556 bytes.
dim fs,f
set fs=server.createobject("scripting.filesystemobject")
set f=fs.getfile("c:\test.asp")
response.write("the size of test.asp is: ")
response.write(f.size & " bytes.")
set f=nothing
set fs=nothing
%>
輸出:
the size of test.asp is: 10556 bytes.
針對(duì) folder 對(duì)象的實(shí)例
<%
dim fs,fo
set fs=server.createobject("scripting.filesystemobject")
set fo=fs.getfolder("c:\test")
response.write("the size of the folder test is: ")
response.write(fo.size & " bytes.")
set fo=nothing
set fs=nothing
%>
輸出:
the size of the folder test is: 123456 bytes.
dim fs,fo
set fs=server.createobject("scripting.filesystemobject")
set fo=fs.getfolder("c:\test")
response.write("the size of the folder test is: ")
response.write(fo.size & " bytes.")
set fo=nothing
set fs=nothing
%>
輸出:
the size of the folder test is: 123456 bytes.

相關(guān)文章
- ASP Cookies
- ASP Session 對(duì)象
- ASP FileSystem 對(duì)象
- ASP Dictionary 對(duì)象
- AJAX 數(shù)據(jù)庫(kù)
- ASP SkipLine 方法
- ASP WriteLine 方法
- ASP DateCreated 屬性
- ASP Path 屬性
- ASP Files 集合
- ASP CreateTextFile 方法
- ASP Exists 方法
- ASP Cookies 集合
- ASP Charset 屬性
- ASP Status 屬性
- ASP StaticObjects 集合
- ASP Contents.RemoveAll 方法
- ASP GetLastError 方法
- ASP DeleteFolder 方法
- ASP GetFile 方法