SignOutUserOperation 類別

定義

允許使用者登出您的應用程式。

注意

如果您要針對Windows 10或更新版本進行開發,請改用Windows.Security.Authentication.Web.Core API。 如需詳細資訊,請參閱 Web 帳戶管理員

public ref class SignOutUserOperation sealed : IAsyncAction
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class SignOutUserOperation final : IAsyncAction
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class SignOutUserOperation : IAsyncAction
Public NotInheritable Class SignOutUserOperation
Implements IAsyncAction
繼承
Object Platform::Object IInspectable SignOutUserOperation
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

此範例示範如何登出應用程式。

function signOut() {
    if (sdkSample.canSignOut) {
        sdkSample.displayStatus("Signing out...");
        authenticator.signOutUserAsync().done(function () {
            sdkSample.accessToken = null;
            sdkSample.authenticatedSafeCustomerId = "";
            sdkSample.isSignedIn = false;
            sdkSample.displayStatus("Signed out.");
        },
            function (status) {
            if (status && (status.name !== "Canceled")) {
                showErrorMessage("Sign out action failed: " + status.message);
            } else {
                sdkSample.displayStatus("");
            }
        });
    }
}

屬性

Completed

取得或設定作業完成時所呼叫的處理常式。

注意

如果您要針對Windows 10或更新版本進行開發,請改用Windows.Security.Authentication.Web.Core API。 如需詳細資訊,請參閱 Web 帳戶管理員

ErrorCode

取得作業失敗時的錯誤碼。

注意

如果您要針對Windows 10或更新版本進行開發,請改用Windows.Security.Authentication.Web.Core API。 如需詳細資訊,請參閱 Web 帳戶管理員

Id

取得代表作業的唯一識別碼。

注意

如果您要針對Windows 10或更新版本進行開發,請改用Windows.Security.Authentication.Web.Core API。 如需詳細資訊,請參閱 Web 帳戶管理員

Status

取得作業的目前狀態。

注意

如果您要針對Windows 10或更新版本進行開發,請改用Windows.Security.Authentication.Web.Core API。 如需詳細資訊,請參閱 Web 帳戶管理員

方法

Cancel()

要求取消作業。

注意

如果您要針對Windows 10或更新版本進行開發,請改用Windows.Security.Authentication.Web.Core API。 如需詳細資訊,請參閱 Web 帳戶管理員

Close()

與作業相關聯的要求應該終止。

注意

如果您要針對Windows 10或更新版本進行開發,請改用Windows.Security.Authentication.Web.Core API。 如需詳細資訊,請參閱 Web 帳戶管理員

GetResults()

傳回作業的結果。 針對這個類別,如果作業成功,則不會傳回任何結果。

注意

如果您要針對Windows 10或更新版本進行開發,請改用Windows.Security.Authentication.Web.Core API。 如需詳細資訊,請參閱 Web 帳戶管理員

適用於