.NET application returns 0 bytes from GetFreeSpace()

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

'****************
 
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??

It turns out that I hadn't included the "Disk Quota User Interface"
component.

Stephen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top