|
-
May 11th, 2005, 07:23 AM
#1
Thread Starter
Junior Member
how do I get a list of all devices? [Resolved]
hi,
I would like to scan through all attached devices, is there a way to get a list of all volumes? (A:,C:,D:,.....)
Last edited by spjansen; May 12th, 2005 at 03:26 AM.
-
May 11th, 2005, 08:22 AM
#2
Re: how do I get a list of all devices?
Code:
foreach(string s in Environment.GetLogicalDrives()){
Console.WriteLine(s);
}
-
May 11th, 2005, 08:35 AM
#3
Member
Re: how do I get a list of all devices?
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
-
May 11th, 2005, 08:49 AM
#4
Thread Starter
Junior Member
Re: how do I get a list of all devices?
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.
-
May 11th, 2005, 10:30 AM
#5
Member
Re: how do I get a list of all devices?
If you're moving to VB.NET from Classic VB, trust me - you'll come to love it after a few months.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|