Visual Basic Scripting Edition | 語言參考 |
FreeSpace 屬性返回指定的驅(qū)動器或網(wǎng)絡(luò)共享對于用戶的可用空間大小。只讀。 object.FreeSpace
object 應(yīng)為 Drive 對象的名稱。 說明FreeSpace 屬性與 AvailableSpace 屬性返回的值基本相同。對于支持限額的計算機系統(tǒng)來說,這兩個屬性返回的值有所差異。 以下代碼舉例說明如何使用 FreeSpace 屬性: Function ShowFreeSpace(drvPath)
Dim fso, d, s
Set fso =CreateObject("Scripting.FileSystemObject")
Set d =fso.GetDrive(fso.GetDriveName(drvPath))
s =" 驅(qū)動器 " & 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 屬性 | IsReady 屬性 | Path 屬性 | RootFolder 屬性 | SerialNumber 屬性 | ShareName 屬性 | TotalSize 屬性 | VolumeName 屬性 應(yīng)用于:Drive 對象 返回首頁 |