Access to other internal hard drives

Hello,

Does anyone know if it is possible to list which internal drives are available on the current device / PC?

My application contains the following code:

var removableFolders = await KnownFolders.RemovableDevices.GetFoldersAsync(); 

When running on Windows 8, this one used for returns any USB devices and SD cards that were connected. In addition, I had a second hard drive (displayed as D: drive) that was returned.

BUT now it seems that when I run this code on my Windows 8.1 machine, my internal hard drive is no longer included in the result of calling await KnownFolders.RemovableDevices.GetFoldersAsync() .

Microsoft may have tightened its code with Windows 8.1, and my drive D: is no longer "RemovableDrive".

Thank you for your help.

+6
source share
1 answer

I do not have enough comments for comments ...

So, you want to determine if there is a second disk, what is it? Are you familiar with the System.IO.DriveInfo class?

  foreach (DriveInfo di in DriveInfo.GetDrives()) { Console.WriteLine(string.Format("{0}: {1}", di.Name, di.DriveType)); } 
0
source

All Articles