sbeaudoin
sbeaudoin

Reputation: 158

UWP Application - How to detect a CDRom or DVDRom device in StorageDevices

In a UWP application, I obtain all the removable devices with :

KnownFolders.RemovableDevices.GetFoldersAsync()

I want to exclude optical devices and keep only the external hard disk or flash devices.

I tried to find a suitable property by using the following :

device.Properties.RetrievePropertiesAsync(...)

and tried a lot of properties from here but can't fin anything.

Anybody have an idea?

Upvotes: 1

Views: 142

Answers (1)

Xie Steven
Xie Steven

Reputation: 8611

You could build an AQS filter string when you enumerate devices. See Build a device selector.

If you are not familiar with the AQS format, you can read more at Using Advanced Query Syntax Programmatically.

Upvotes: 0

Related Questions