Properti Size ASP
Definisi dan Penggunaan
Properti Size digunakan untuk kembalikan bilangan byte yang ditentukan bagi fail atau folder.
Syarat:
FileObject.Size FolderObject.Size
Contoh
Contoh untuk objek File
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.GetFile("c:\test.asp") Response.Write("Saiz test.asp adalah: ") Response.Write(f.Size & " bytes.") set f=nothing set fs=nothing %>
Output:
Saiz test.asp adalah: 18665 bytes.
Contoh untuk objek Folder
<% dim fs,fo set fs=Server.CreateObject("Scripting.FileSystemObject") set fo=fs.GetFolder("c:\test") Response.Write("Saiz-folder test adalah: ") Response.Write(fo.Size & " bytes.") set fo=nothing set fs=nothing %>
Output:
Saiz tes folder adalah: 652398 bytes.