Microsoft gives the following get available space function but no C#
function and I have seen that a lot where system functions like that
are only shown with examples for VB (Visual Basic)
Can anyone comment on this situation. Below is visual basic code for
geting free disk space
where is the C# version??
Public Function GetDiskSpace() As System.UInt64
Dim diskClass As _
New System.Management.ManagementClass("Win32_LogicalDi sk")
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