hi,
I would like to scan through all attached devices, is there a way to get a list of all volumes? (A:,C:,D:,.....)
Printable View
hi,
I would like to scan through all attached devices, is there a way to get a list of all volumes? (A:,C:,D:,.....)
Code:foreach(string s in Environment.GetLogicalDrives()){
Console.WriteLine(s);
}
Just trying to help out - I'm sure you won't need this translation from C#, but just in case:
VB Code:
For Each s As String In Environment.GetLogicalDrives() Console.WriteLine(s) Next 'or: For Each s2 As String In System.IO.Directory.GetLogicalDrives() Console.WriteLine(s2) Next
that helped a lot, thank you.
I use .net for a week now and I still cant figure out where to find the classes I need. stupid namespaces.
If you're moving to VB.NET from Classic VB, trust me - you'll come to love it after a few months.