How to view available hard drives
-
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");
-
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");
System.Environment.GetLogicalDrives()
« Superman »
-
System.Environment.GetLogicalDrives()
« Superman »
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");