I need to create 2 progress bars which describe the free and total space, in megabytes, on the given drive? could any body please inform me how to do this?
Thanks in advance
Regards
Winan
I need to create 2 progress bars which describe the free and total space, in megabytes, on the given drive? could any body please inform me how to do this?
Thanks in advance
Regards
Winan
Get the free and total space values, set the maximum property to the total, see the free to the Value property.
But I though the difficult part is to get the free disk space and also to get the total disk space.. any idea?
TIA
Winanjaya
:=) thought you had that part lol...
http://msdn.microsoft.com/library/de...isualBasic.asp
http://www.codeproject.com/file/ngdiskspacemonitor.asp
Thanks .. I got below codes (from msdn) : to get free disk space information ..
Public Function GetDiskSpace() 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")) = "C:" Then
space = CType(disk("FreeSpace"), System.UInt64)
End If
Next disk
Return space
End Function
My question are:
1. How to get total disk capacity?
2. disk("FreeSpace") .. Could you please inform me where can I get the list of the property name of the item of disk ..
many thanks in advance
Best Regards
Winanjaya
Try one of these 4 examples..
http://www.planetsourcecode.com/vb/s...riteria=volume
;) :wave: