I admit defeat! 
I am using Visual Basic 2008 - and after around 4-5 hours of searching every nook and cranny of the net I cannot for the life of me find the right solution.
I want to display the available space of a hard drive in a text box. Simple!
I have lots of code (mostly VB6 - I'm asking myself why I went with 2008), such as this taken from VB 2008 help online:
Imports System
Imports System.IO
Class Test
Public Shared Sub Main()
Dim allDrives() As DriveInfo = DriveInfo.GetDrives()
Dim d As DriveInfo
For Each d In allDrives
Console.WriteLine("Drive {0}", d.Name)
Console.WriteLine(" File type: {0}", d.DriveType)
If d.IsReady = True Then
Console.WriteLine(" Volume label: {0}", d.VolumeLabel)
Console.WriteLine(" File system: {0}", d.DriveFormat)
Console.WriteLine( _
" Available space to current user:{0, 15} bytes", _
d.AvailableFreeSpace)
Console.WriteLine( _
" Total available space: {0, 15} bytes", _
d.TotalFreeSpace)
Console.WriteLine( _
" Total size of drive: {0, 15} bytes ", _
d.TotalSize)
End If
Next
End Sub
End Class
And i get.....nothing!!
I have vbscript that performs perfectly well, but visual basic won't run the vbscript file (this is why I use a Mac!!)
I'd like this function to run as soon as the form loads.... well actually I'd like a bottle of wine and a night out, but hey ho!
Anybody, somebody.... lend me your ears.

I am using Visual Basic 2008 - and after around 4-5 hours of searching every nook and cranny of the net I cannot for the life of me find the right solution.
I want to display the available space of a hard drive in a text box. Simple!

I have lots of code (mostly VB6 - I'm asking myself why I went with 2008), such as this taken from VB 2008 help online:
Imports System
Imports System.IO
Class Test
Public Shared Sub Main()
Dim allDrives() As DriveInfo = DriveInfo.GetDrives()
Dim d As DriveInfo
For Each d In allDrives
Console.WriteLine("Drive {0}", d.Name)
Console.WriteLine(" File type: {0}", d.DriveType)
If d.IsReady = True Then
Console.WriteLine(" Volume label: {0}", d.VolumeLabel)
Console.WriteLine(" File system: {0}", d.DriveFormat)
Console.WriteLine( _
" Available space to current user:{0, 15} bytes", _
d.AvailableFreeSpace)
Console.WriteLine( _
" Total available space: {0, 15} bytes", _
d.TotalFreeSpace)
Console.WriteLine( _
" Total size of drive: {0, 15} bytes ", _
d.TotalSize)
End If
Next
End Sub
End Class
And i get.....nothing!!
I have vbscript that performs perfectly well, but visual basic won't run the vbscript file (this is why I use a Mac!!)

I'd like this function to run as soon as the form loads.... well actually I'd like a bottle of wine and a night out, but hey ho!
Anybody, somebody.... lend me your ears.