![]() | Register | FAQ | Members | Social Groups | User Map | Calendar | Search | Today's Posts | Mark Forums Read |
| | | LinkBack | Thread Tools | Search Thread | Language |
| Sponsored Links |
| | #1 |
![]() | We can get free space of a drive, but its slighly different to the figure displayed there. Was wondering if there is some code to just read the figure from there. |
| |
| | #2 |
![]() Join Date: Jun 2008
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 | Can you tell us the two amounts? is one dividing by 1000 for bits and the other by 1024 for bits? it can change the size dramatically on large drives. Give more details and we will see |
| |
| | #3 |
![]() Join Date: Feb 2008 Location: Stevenage, Hertfordshire
Posts: 81
Thanks: 0
Thanked 2 Times in 1 Post
Rep Power: 2 | wellll. this is weird!!! i have just been building an application for work that does this... you will need to add: Imports System.IO then this is how iv done mine.. Code: Dim alldrives() As DriveInfo = DriveInfo.GetDrives 'setting up the main function for getting drive infomation Dim a_total = Format(alldrives(10).TotalSize / 1024 / 1024 / 1024, "#0.0") Dim a_freespace = Format(alldrives(10).TotalFreeSpace / 1024 / 1024 / 1024, "#0.0") Label6.Text = a_total & " GB" 'total HDD Size Label5.Text = a_freespace & " GB" 'Free space 'A nice progress bar! ProgressBar1.Maximum = a_total ProgressBar1.Minimum = 0 ProgressBar1.Value = a_freespace the progress bar is set up how i like it, but you might want it diffrent.. let me explain.. lets use an example HDD size of 100GB and 80GB free if you have ProgressBar1.Value set as: ProgressBar1.Value = a_freespace It will fill the progress bar 80% but. if you have: ProgressBar1.Value = a_total - a_freespace it will fill the progress bar with used amount. so will only fill it 20% OOOO! i forgot! you change what drive you are getting the infomation from with: from: alldrives(NUMBER HERE) it takes a bit of playing about. but i found out, if you step through it. (and then over it, so its loaded the infomation into that VAR) then you can hover over the where alldrive() is defined and it will give you a list of drives and there ID number.. any more problems. give me a shout.. but thats what i use. and it works niceely |
| |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Vista Free Space doesn't make sense | link470 | Windows Vista | 4 | 07-07-2008 10:37 PM |
| Running out of space | ricki | Networks | 1 | 13-05-2008 09:49 AM |
| Free free space wipe tool needed asap! | tech_guy | Windows | 5 | 28-02-2008 04:56 PM |
| Space Shuttle is on its way to the International Space Stati | tickmike | General Chat | 2 | 12-12-2006 01:56 PM |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search Thread |
|
|




