Results 1 to 5 of 5

Thread: how do I get a list of all devices? [Resolved]

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    16

    Resolved 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.

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    Re: how do I get a list of all devices?

    Code:
    foreach(string s in Environment.GetLogicalDrives()){
        Console.WriteLine(s);
    }

  3. #3
    Member
    Join Date
    Sep 2004
    Posts
    52

    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:
    1. For Each s As String In Environment.GetLogicalDrives()
    2.  Console.WriteLine(s)
    3.         Next
    4.  
    5. 'or:
    6.         For Each s2 As String In System.IO.Directory.GetLogicalDrives()
    7.             Console.WriteLine(s2)
    8.         Next

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    16

    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.

  5. #5
    Member
    Join Date
    Sep 2004
    Posts
    52

    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
  •  



Click Here to Expand Forum to Full Width