共用方式為


PasswordCredential 類別

定義

表示密碼認證存放區。

public ref class PasswordCredential sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Security.Credentials.ICredentialFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class PasswordCredential final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(Windows.Security.Credentials.ICredentialFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class PasswordCredential final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Security.Credentials.ICredentialFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class PasswordCredential
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Security.Credentials.ICredentialFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class PasswordCredential
function PasswordCredential(resource, userName, password)
Public NotInheritable Class PasswordCredential
繼承
Object Platform::Object IInspectable PasswordCredential
屬性

Windows 需求

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

建構函式

PasswordCredential()

建立並初始化 PasswordCredential 物件的新空白實例。

PasswordCredential(String, String, String)

建立並初始化包含所提供認證資料之 PasswordCredential 物件的新實例。

屬性

Password

取得或設定認證的密碼字串。 此值不得為 Null 或空白,否則會擲回例外狀況。 您必須先呼叫 RetrievePassword ,才能設定此屬性的初始值。

Properties

此 API 僅供內部使用,不應用於您的程式碼。

Resource

取得或設定認證的資源。

UserName

取得或設定認證的使用者名稱。 此值不得為 Null 或空白,否則會擲回例外狀況。

方法

RetrievePassword()

填入認證的密碼。 成功傳回作業之後,您可以從 Password 屬性取得密碼。

適用於