提供對磁盤驅動器或網絡共享的屬性的訪問。
以下代碼舉例說明如何使用 Drive 對象訪問驅動器的屬性:
Function ShowFreeSpace(drvPath)Dim fso, d, s Set fso = CreateObject("Scripting.FileSystemObject") Set d = fso.GetDrive(fso.GetDriveName(drvPath)) s = "
驅動器" & UCase(drvPath) & " - "
s = s & d.VolumeName & "<BR>"
s = s & "
可用空間:" & FormatNumber(d.FreeSpace/1024, 0)
s = s & "KB"
ShowFreeSpace = s
End Function
新聞熱點
疑難解答