Results 1 to 2 of 2

Thread: please arrange this sample code for getting hard disk spce using win32_logicaldisk.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2008
    Posts
    235

    please arrange this sample code for getting hard disk spce using win32_logicaldisk.

    hi all

    i am using this code to get free space of hard disk drives. i want to get the logical drives ie.(C: 10GB, D: 5.8GB, E: 6.2GB) with free space on individual logical drives, inside a "label.text" or some other suitable container.

    please somebody re-arrange this code.


    Code:
    page load()
    {
    
    ManagementClass partionsClass = new ManagementClass("Win32_LogicalDisk");
     ManagementObjectCollection partions = partionsClass.GetInstances();
     string hdd = string.Empty;
       foreach (ManagementObject partion in partions)
           {
          hdd = Convert.ToString(partion["freespace"]);
    }
    }

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: please arrange this sample code for getting hard disk spce using win32_logicaldisk.

    What does that code do currently?
    What is it not doing that you want it to do?

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