Stupid question

  • Thread starter Thread starter PaulRuebens
  • Start date Start date
P

PaulRuebens

Guest
Okay Im doing a basic program to see how VB NET works. It simple in that I want to just list the drives on my machine. So far here is my code

Code:
dim sDrives() as String
dim i as integer
sDrives = Directory.GetlogicalDrives()
For i = 0 to Ubound(sDrives)
 Console.Writeline(sDrives(i))
Next

Problem Im getting is that I get an error back that says "Directory not declared".......

did I do something wrong? Thanks!
 
Try this:
Code:
        Dim sDrives() As String
        Dim i As Integer
        sDrives = System.IO.Directory.GetLogicalDrives()
        For i = 0 To UBound(sDrives)
            Console.WriteLine(sDrives(i))
        Next
 
Thanks Spike.......

I actually figured out a solution. I love learing new tricks!

Anyway At the very TOP of my code I put in Imports System.IO and it worked like I needed it to!
 
Back
Top