![](/img/trans.png)
[英]Using DeviceID from Windows.Devices.Enumeration to find the Drive Letter of a Removable Drive (USB) in C# Windows 10 IoT Core?
[英]Unable to find Windows.Devices.Enumeration and Windows.Storage.Streams
我需要在 Windows 7 上的 Winforms 應用程序中使用 Windows.Storage.Streams 和 Windows.Devices.Enumeration 來訪問和操作條形碼閱讀器,但無法找到它以添加參考。 不確定是否可以在某個地方下載它。 我能夠找到並下載 Microsoft.PointOfService 並添加了對我的項目的引用,但不是前兩個庫。
請指教。
Windows.Storage.Streams和Windows.Devices.Enumeration命名空間是 Windows 運行時的一部分。 要使用它們,您需要以 Windows 8 或更高版本為目標。 它們在面向 Windows 7 時不可用。
如何從 WPF 訪問 Windows 10 API
您可以從預先存在的 WPF 項目訪問 Windows 10 API。 為此,請轉到您的解決方案資源管理器窗口並...
為了幫助通過 Google 到達這里的其他人,Microsoft 提供了一些 NuGet 包來訪問 Windows 特定的 API,而無需手動導入或引用 Windows 庫。 更多信息可以在這里查看他們的文檔。
對於那些嘗試從 Windows 8/8.1 使用它的用戶,請分別在 32 位C:\Windows\System32\WinMetadata
或 64 位C:\Windows\System32\WinMetadata
的文件中添加參考(如 Sajeeb 的回答)。
我相信這些命名空間不是 Windows 應用程序庫的一部分。 我不認為 WinForm 項目能夠使用它們。 就個人而言,我沒有更新版本的 VS,所以我不確定。 但是在 VS2015 以后應該有一個新的項目類型。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.