| GetFile() | ใช้สร้างออปเจ็ค file |
|---|---|
| Name | ใช้คืนค่าชื่อของไฟล์ จาก URL |
| Type | ใช้คืนค่าประเภทของไฟล์ |
| Size | ใช้คืนค่าขนาดของไฟล์ |
| DateCreated | ใช้คืนค่าวันที่สร้างไฟล์ |
| DateLastAccessed | ใช้คืนค่า วันที่ล่าสุดที่ไฟล์ถูกเปิดใช้งาน |
| DateLastModified | ใช้คืนค่า วันที่ล่าสุดที่ไฟล์ถูกปรับปรุง |
| ParentFolder | ใช้คืนค่า Folder ของ File |
| Files | ใช้คืนค่า Collection Files ทั้งหมดที่มีอยู่ใน Folder |
method:GetFile ( “phpsical-path” )
return type:Object
content:ใช้สร้างออปเจ็ค file
example:Set fsystem = CreateObject ( “Scripting.FileSystemObject” ) virtualpath = Request.ServerVariables ( “PATH_INFO” ) pyhsicalpath = Server.MapPath ( virtualpath ) Set file = fsystem.GetFile ( physicalpath )
comment:Server.MapPath ใช้แปลง virtual-path เป็น physical-path
property:Name
return type:String
content:ใช้คืนค่าชื่อของไฟล์ จาก URL
example:Set fsystem = CreateObject ( “Scripting.FileSystemObject” ) virtualpath = Request.ServerVariables ( “PATH_INFO” ) pyhsicalpath = Server.MapPath ( virtualpath ) Set file = fsystem.GetFile ( physicalpath ) Dim filename = file.Name
property:Type
return type:String
content:ใช้คืนค่าประเภทของไฟล์
example:Set fsystem = CreateObject ( “Scripting.FileSystemObject” ) virtualpath = Request.ServerVariables ( “PATH_INFO” ) pyhsicalpath = Server.MapPath ( virtualpath ) Set file = fsystem.GetFile ( physicalpath ) Dim filetype = file.Type
property:Size
return type:Number
content:ใช้คืนค่าขนาดของไฟล์
example:Set fsystem = CreateObject ( “Scripting.FileSystemObject” ) virtualpath = Request.ServerVariables ( “PATH_INFO” ) pyhsicalpath = Server.MapPath ( virtualpath ) Set file = fsystem.GetFile ( physicalpath ) Dim file_size = file.Size
property:DateCreated
return type:Date
content:ใช้คืนค่าวันที่สร้างไฟล์
example:Set fsystem = CreateObject ( “Scripting.FileSystemObject” ) virtualpath = Request.ServerVariables ( “PATH_INFO” ) pyhsicalpath = Server.MapPath ( virtualpath ) Set file = fsystem.GetFile ( physicalpath ) Dim created_file = file.DateCreated
property:DateLastAccessed
return type:Date
content:ใช้คืนค่า วันที่ล่าสุดที่ไฟล์ถูกเปิดใช้งาน
example:Set fsystem = CreateObject ( “Scripting.FileSystemObject” ) virtualpath = Request.ServerVariables ( “PATH_INFO” ) pyhsicalpath = Server.MapPath ( virtualpath ) Set file = fsystem.GetFile ( physicalpath ) Dim lastaccess_file = file.DateLastAccessed
property:DateLastModified
return type:Date
content:ใช้คืนค่า วันที่ล่าสุดที่ไฟล์ถูกปรับปรุง
example:Set fsystem = CreateObject ( “Scripting.FileSystemObject” ) virtualpath = Request.ServerVariables ( “PATH_INFO” ) pyhsicalpath = Server.MapPath ( virtualpath ) Set file = fsystem.GetFile ( physicalpath ) Dim lastmodified_file = file.DateLastModified
property:ParentFolder
return type:Object
content:ใช้คืนค่า Folder ของ File
example:Set fsystem = CreateObject ( “Scripting.FileSystemObject” ) virtualpath = Request.ServerVariables ( “PATH_INFO” ) pyhsicalpath = Server.MapPath ( virtualpath ) Set file = fsystem.GetFile ( physicalpath ) Set folder = file.ParentFolder
property:Files
return type:Object
content:ใช้คืนค่า Collection Files ทั้งหมดที่มีอยู่ใน Folder
example:Set fsystem = CreateObject ( “Scripting.FileSystemObject” ) virtualpath = Request.ServerVariables ( “PATH_INFO” ) pyhsicalpath = Server.MapPath ( virtualpath ) Set file = fsystem.GetFile ( physicalpath ) Set folder = file.ParentFolder Set allfile = folder.Files For Each eachfile In allfile Response.write eachfile.Name Next