UserConsentVerificationResult Перечисление

Определение

Описывает результат операции проверки.

public enum class UserConsentVerificationResult
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class UserConsentVerificationResult
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum UserConsentVerificationResult
var value = Windows.Security.Credentials.UI.UserConsentVerificationResult.verified
Public Enum UserConsentVerificationResult
Наследование
UserConsentVerificationResult
Атрибуты

Требования к Windows

Семейство устройств
Windows 10 (появилось в 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (появилось в v1.0)

Поля

Canceled 6

Операция проверки была отменена.

DeviceBusy 4

Устройство проверки подлинности выполняет операцию и недоступно.

DeviceNotPresent 1

Устройство для проверки подлинности недоступно.

DisabledByPolicy 3

В групповой политике отключена проверка подлинности устройства.

NotConfiguredForUser 2

Устройство проверки подлинности не настроено для этого пользователя.

RetriesExhausted 5

После 10 попыток исходный запрос на проверку и все последующие попытки той же проверки не были проверены.

Verified 0

Пользователь был проверен.

Примеры

В следующем примере показан метод, который запрашивает проверку с устройства проверки подлинности и возвращает сообщение, описывающее результат на основе значения UserConsentVerificationResult.

private async System.Threading.Tasks.Task<string> RequestConsent(string userMessage)
{
    string returnMessage;

    // Request the logged on user's consent via authentication device.
    var consentResult = await Windows.Security.Credentials.UI.UserConsentVerifier.RequestVerificationAsync(userMessage);

    switch (consentResult)
    {
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.Verified:
            returnMessage = "User verified.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.DeviceBusy:
            returnMessage = "Authentication device is busy.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.DeviceNotPresent:
            returnMessage = "No authentication device found.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.DisabledByPolicy:
            returnMessage = "Authentication device verification is disabled by policy.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.NotConfiguredForUser:
            returnMessage = "Please go to Account Settings to set up PIN or other advanced authentication.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.RetriesExhausted:
            returnMessage = "There have been too many failed attempts. Device authentication canceled.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.Canceled:
            returnMessage = "Device authentication canceled.";
            break;
        default:
            returnMessage = "Authentication device is currently unavailable.";
            break;
    }
    return returnMessage;
}

Применяется к

См. также раздел