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 IInspectable PasswordCredential
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

构造函数

PasswordCredential()

创建并初始化 PasswordCredential 对象的新空实例。

PasswordCredential(String, String, String)

创建并初始化包含提供的凭据数据的密码 Credential 对象的新实例。

属性

Password

获取或设置凭据的密码字符串。 此值不得为 null 或空,否则将引发异常。 必须首先调用 RetrievePassword 才能设置此属性的初始值。

Properties

此 API 仅用于内部使用,不应在代码中使用。

Resource

获取或设置凭据的资源。

UserName

获取或设置凭据的用户名。 此值不得为 null 或空,否则将引发异常。

方法

RetrievePassword()

填充凭据的密码。 操作成功返回后,可以从 Password 属性获取密码。

适用于