Hard drive Info
-
What would I type to get a computers Harddrive total space and used space? I have been looking around allot and all I have found is useless VB 6 code and some jibberish in C#, can someone please help me with this. Many Thanks :confused:
-
What would I type to get a computers Harddrive total space and used space? I have been looking around allot and all I have found is useless VB 6 code and some jibberish in C#, can someone please help me with this. Many Thanks :confused:
System.IO.DriveInfo Boy, you're being a P.I.A. today. You're gonna owe me a cut of that app. :laugh:
-
System.IO.DriveInfo Boy, you're being a P.I.A. today. You're gonna owe me a cut of that app. :laugh:
that easy!!! omg.. sorry for the dumb question :-D
-
that easy!!! omg.. sorry for the dumb question :-D
:laugh: - You crack me up, Dude. Hey, the only dumb question is the one you should have asked and didn't, right? :)
-
System.IO.DriveInfo Boy, you're being a P.I.A. today. You're gonna owe me a cut of that app. :laugh:
Ah hell now i came to another bottleneck... um (feels very stupid) how can i use this to display the actual total size of a drive because so far i can get it to say 16Bytes when it should be saying 250GB (well in that region)
-
Ah hell now i came to another bottleneck... um (feels very stupid) how can i use this to display the actual total size of a drive because so far i can get it to say 16Bytes when it should be saying 250GB (well in that region)
Try something like this:
Dim dr As New System.IO.DriveInfo("C") Dim sizeInBytes As Long Dim sizeInGB As Single sizeInBytes = dr.TotalSize sizeInGB = sizeInBytes / 1000000000 TextBox1.Text = String.Format("Total Drive Size in Bytes: {0}", sizeInBytes.ToString("#,###,###,###,###")) TextBox2.Text = String.Format("Total Drive Size in GB: {0}", sizeInGB.ToString("###,###,###,###.00"))
You can play around with the verbage, divisor value, and formatting as you prefer.
-
Try something like this:
Dim dr As New System.IO.DriveInfo("C") Dim sizeInBytes As Long Dim sizeInGB As Single sizeInBytes = dr.TotalSize sizeInGB = sizeInBytes / 1000000000 TextBox1.Text = String.Format("Total Drive Size in Bytes: {0}", sizeInBytes.ToString("#,###,###,###,###")) TextBox2.Text = String.Format("Total Drive Size in GB: {0}", sizeInGB.ToString("###,###,###,###.00"))
You can play around with the verbage, divisor value, and formatting as you prefer.
Yes!! thanks so much for this golden nugget i been searching for something like this for ages whew THANK YOU!! :-D
-
Yes!! thanks so much for this golden nugget i been searching for something like this for ages whew THANK YOU!! :-D
You're welcome! :-D (I gotta go do some nasty work for a while now. Fighting an 8-headed datagrid monster. Catch ya later. Happy coding.)