Public Function GetDiskSpace() As String
Dim diskClass As _
New System.Management.ManagementClass("Win32_LogicalDisk")
Dim disks As System.Management.ManagementObjectCollection = _
diskClass.GetInstances()
Dim disk As System.Management.ManagementObject
Dim space As System.UInt64
For Each disk In disks
If CStr(disk("Name")) = "C:" Then
space = CType(disk("FreeSpace"), System.UInt64)
End If
Next disk
Return space
End Function
2006-08-30
02:21:44
·
1 answers
·
asked by
VBNewComer
1
in
Computers & Internet
➔ Programming & Design
It gives error in
diskClass.GetInstances()
I have done it thru msgbox and exception handling too, but can't resolve why getinstances is not found ?
Thanks for answer, can you please help me further ?
2006-08-30
03:44:19 ·
update #1