S
Stephen Bashford
We have a .NET 1.1 application that queries the free disk space on the C
drive.
This worked just fine under XP Pro.
However, under XPe it returns 0 bytes.
Any suggestions??
TIA,
Stephen
'*************
Public Function GetDiskSpace(ByVal drv As String) As System.UInt64
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")) = drv Then
space = CType(disk("FreeSpace"), System.UInt64)
End If
Next disk
Return space
End Function
'****************
drive.
This worked just fine under XP Pro.
However, under XPe it returns 0 bytes.
Any suggestions??
TIA,
Stephen
'*************
Public Function GetDiskSpace(ByVal drv As String) As System.UInt64
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")) = drv Then
space = CType(disk("FreeSpace"), System.UInt64)
End If
Next disk
Return space
End Function
'****************