我的電腦應該由下面的代碼片段返回工作的智能卡讀寫器:如何使用await語法從Windows.Devices.Enumeration.DeviceInformation.FindAllAsync中讀取結果?
string selector = Windows.Devices.SmartCards.SmartCardReader.GetDeviceSelector();
Windows.Devices.Enumeration.DeviceInformationCollection devices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(selector);
不過,我得到這個錯誤:
Error CS4036 '
IAsyncOperation<DeviceInformationCollection>
' does not contain a definition for 'GetAwaiter
' and no extension method 'GetAwaiter
' accepting a first argument of type 'IAsyncOperation<DeviceInformationCollection>
' could be found (are you missing a using directive for 'System
'?)
的代碼片段從Microsoft's C# Sample Code
複製我能做些什麼來解決這個錯誤?