简体   繁体   English

UWP应用程序-如何在StorageDevices中检测CDRom或DVDRom设备

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

In a UWP application, I obtain all the removable devices with : 在UWP应用程序中,我使用以下命令获取所有可移动设备:

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? 有人有主意吗?

You could build an AQS filter string when you enumerate devices. 枚举设备时,您可以构建AQS过滤器字符串。 See Build a device selector . 请参阅构建设备选择器

If you are not familiar with the AQS format, you can read more at Using Advanced Query Syntax Programmatically . 如果您不熟悉AQS格式,可以在以编程方式使用高级查询语法中阅读更多内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM