Visual Basic Scripting Edition | 語(yǔ)言參考 |
提供對(duì)磁盤驅(qū)動(dòng)器或網(wǎng)絡(luò)共享的屬性的訪問(wèn)。
以下代碼舉例說(shuō)明如何使用 Drive 對(duì)象訪問(wèn)驅(qū)動(dòng)器的屬性:
Function ShowFreeSpace(drvPath) Dim fso, d, s Set fso = CreateObject("Scripting.FileSystemObject") Set d = fso.GetDrive(fso.GetDriveName(drvPath)) s = "
驅(qū)動(dòng)器" & UCase(drvPath) & " - "
s = s & d.VolumeName & "<BR>"
s = s & "
可用空間:" & FormatNumber(d.FreeSpace/1024, 0)
s = s & "KB"
ShowFreeSpace = s
End Function
AvailableSpace 屬性 | DriveLetter 屬性 | DriveType 屬性 | FileSystem 屬性 | FreeSpace 屬性 | IsReady 屬性 | Path 屬性 | RootFolder 屬性 | SerialNumber 屬性 | ShareName 屬性 | TotalSize 屬性 | VolumeName 屬性
Drive 對(duì)象無(wú)任何方法。
Drives 集合 | File 對(duì)象 | Files 集合 | Folder 對(duì)象 | Folders 集合 | GetDrive 方法