Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to view available hard drives

How to view available hard drives

Scheduled Pinned Locked Moved C#
csharpperformancehelptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MartyExodus
    wrote on last edited by
    #1

    I'm writing a program in C# 2005 Express and one of its functions is to scan the hard drives of the computer for specific files. However, due to the diversity of the machines this program will run on, I cannot guarantee the drive letters for each hard drive. Is there any way I can find the available drives so I can limit and speed up my scan? I know I could use HKLM>Software>Microsoft>Windows>CurrentVersion>Explorer>MountPoints2 to find what drives are there.... but that doesn't distinguish between drive types (Hard Drive, Floppy Drie, CD Drive). And help would be greatly appreciated.

    ------------------------ using System.People; Person me = new Person(); me.Certifications = null; me.Experience = little; me.WantsToLearn = true; me.InSchool = true; me.AskQuestions("C# .NET 2003");

    _ 1 Reply Last reply
    0
    • M MartyExodus

      I'm writing a program in C# 2005 Express and one of its functions is to scan the hard drives of the computer for specific files. However, due to the diversity of the machines this program will run on, I cannot guarantee the drive letters for each hard drive. Is there any way I can find the available drives so I can limit and speed up my scan? I know I could use HKLM>Software>Microsoft>Windows>CurrentVersion>Explorer>MountPoints2 to find what drives are there.... but that doesn't distinguish between drive types (Hard Drive, Floppy Drie, CD Drive). And help would be greatly appreciated.

      ------------------------ using System.People; Person me = new Person(); me.Certifications = null; me.Experience = little; me.WantsToLearn = true; me.InSchool = true; me.AskQuestions("C# .NET 2003");

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      System.Environment.GetLogicalDrives()

      « Superman »

      M 1 Reply Last reply
      0
      • _ _Superman_

        System.Environment.GetLogicalDrives()

        « Superman »

        M Offline
        M Offline
        MartyExodus
        wrote on last edited by
        #3

        Ha. Thanks. I can use that with System.IO.DriveInfo to get what I need. That's what I love about CodeProject... response within a half hour.

        ------------------------ using System.People; Person me = new Person(); me.Certifications = null; me.Experience = little; me.WantsToLearn = true; me.InSchool = true; me.AskQuestions("C# .NET 2003");

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups