Drive 對(duì)象提供對(duì)磁盤(pán)驅(qū)動(dòng)器或網(wǎng)絡(luò)共享的屬性的訪(fǎng)問(wèn)。 說(shuō)明以下代碼舉例說(shuō)明如何使用 Drive 對(duì)象訪(fǎng)問(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ú)任何方法。 請(qǐng)參閱Drives 集合 | File 對(duì)象 | Files 集合 | Folder 對(duì)象 | Folders 集合 | GetDrive 方法 返回首頁(yè) |