UserConsentVerifierAvailability 列舉
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
描述驗證裝置檢查的結果,例如指紋讀取器。
public enum class UserConsentVerifierAvailability
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class UserConsentVerifierAvailability
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum UserConsentVerifierAvailability
var value = Windows.Security.Credentials.UI.UserConsentVerifierAvailability.available
Public Enum UserConsentVerifierAvailability
- 繼承
-
UserConsentVerifierAvailability
- 屬性
Windows 需求
裝置系列 |
Windows 10 (已於 10.0.10240.0 引進)
|
API contract |
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)
|
欄位
Available | 0 | 驗證裝置可供使用。 |
DeviceBusy | 4 | 驗證裝置正在執行作業,而且無法使用。 |
DeviceNotPresent | 1 | 沒有可用的驗證裝置。 |
DisabledByPolicy | 3 | 組策略已停用驗證裝置。 |
NotConfiguredForUser | 2 | 此使用者未設定驗證裝置。 |
範例
下列範例顯示檢查目前使用者是否支持驗證裝置的方法,並傳回根據UserConsentVerifierAvailability值描述結果的訊息。
public async System.Threading.Tasks.Task<string> CheckDeviceAvailability()
{
string returnMessage;
// Check the availability of device authentication.
var ucvAvailability = await Windows.Security.Credentials.UI.UserConsentVerifier.CheckAvailabilityAsync();
switch (ucvAvailability)
{
case Windows.Security.Credentials.UI.UserConsentVerifierAvailability.Available:
returnMessage = "Authentication device is available.";
break;
case Windows.Security.Credentials.UI.UserConsentVerifierAvailability.DeviceBusy:
returnMessage = "Authentication device is busy.";
break;
case Windows.Security.Credentials.UI.UserConsentVerifierAvailability.DeviceNotPresent:
returnMessage = "No authentication device found.";
break;
case Windows.Security.Credentials.UI.UserConsentVerifierAvailability.DisabledByPolicy:
returnMessage = "Authentication device verification is disabled by policy.";
break;
case Windows.Security.Credentials.UI.UserConsentVerifierAvailability.NotConfiguredForUser:
returnMessage = "Please go to Account Settings to set up a PIN or other advanced authentication.";
break;
default:
returnMessage = "Authentication device is currently unavailable.";
break;
}
return returnMessage;
}
備註
您可以使用 CheckAvailabilityAsync 方法來判斷目前電腦是否支援指紋驗證。