Results 1 to 6 of 6

Thread: 2 progress bars which describe the free and total space, in megabytes

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    Question 2 progress bars which describe the free and total space, in megabytes

    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

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Get the free and total space values, set the maximum property to the total, see the free to the Value property.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784
    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

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    Question

    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

  6. #6
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width