วัตถุไดรฟ์ ASP
ออบเจ็กต์ไดรฟ์ใช้เพื่อรับข้อมูลเกี่ยวกับไดรฟ์ในเครื่องหรือการแชร์เครือข่าย
ตัวอย่างเพิ่มเติม
วิธีรับขนาดรวมของไดรฟ์ที่ระบุ
วิธีรับพื้นที่ว่างของไดรฟ์ที่ระบุ
วิธีรับพื้นที่ว่างของไดรฟ์ที่ระบุ
วิธีรับอักษรระบุไดรฟ์ของไดรฟ์ที่ระบุ
วิธีรับประเภทไดรฟ์ของไดรฟ์ที่ระบุ
วิธีรับระบบไฟล์ของไดรฟ์ที่ระบุ
วิธีตรวจสอบว่าไดรฟ์ที่ระบุพร้อมหรือไม่
วิธีรับเส้นทางของไดรฟ์ที่ระบุ
วิธีรับโฟลเดอร์รูทของไดรฟ์ที่ระบุ
วิธีรับหมายเลขซีเรียลของไดรฟ์ที่ระบุ
วัตถุของไดรฟ์
ออบเจ็กต์ Drive ใช้เพื่อส่งคืนข้อมูลเกี่ยวกับดิสก์ไดรฟ์ภายในเครื่องหรือการแชร์เครือข่าย ออบเจ็กต์ไดรฟ์สามารถส่งคืนข้อมูลเกี่ยวกับประเภทระบบไฟล์ของไดรฟ์ พื้นที่ว่าง หมายเลขซีเรียล ชื่อวอลุ่ม และอื่นๆ
หมายเหตุ:คุณไม่สามารถส่งคืนข้อมูลเกี่ยวกับเนื้อหาของไดรฟ์ด้วยวัตถุไดรฟ์ เพื่อจุดประสงค์นี้ คุณจะต้องใช้วัตถุโฟลเดอร์
ในการทำงานกับคุณสมบัติของวัตถุ Drive คุณจะต้องสร้างอินสแตนซ์ของวัตถุ Drive ผ่านวัตถุ FileSystemObject อันดับแรก; สร้างวัตถุ FileSystemObject แล้วสร้างอินสแตนซ์ของวัตถุ Drive ผ่านวิธี GetDrive หรือคุณสมบัติ Drives ของวัตถุ FileSystemObject
คุณสมบัติของออบเจ็กต์ Drive มีรายละเอียดดังนี้:
คุณสมบัติ
Property | Description |
---|---|
AvailableSpace | Returns the amount of available space to a user on a specified drive or network share |
DriveLetter | Returns one uppercase letter that identifies the local drive or a network share |
DriveType | Returns the type of a specified drive |
FileSystem | Returns the file system in use for a specified drive |
FreeSpace | Returns the amount of free space to a user on a specified drive or network share |
IsReady | Returns true if the specified drive is ready and false if not |
Path | Returns an uppercase letter followed by a colon that indicates the path name for a specified drive |
RootFolder | Returns a Folder object that represents the root folder of a specified drive |
SerialNumber | Returns the serial number of a specified drive |
ShareName | Returns the network share name for a specified drive |
TotalSize | Returns the total size of a specified drive or network share |
VolumeName | Sets or returns the volume name of a specified drive |