Bagikan melalui


PasswordCredential Kelas

Definisi

Mewakili penyimpanan kredensial kata sandi.

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
Warisan
Object Platform::Object IInspectable PasswordCredential
Atribut

Persyaratan Windows

Rangkaian perangkat
Windows 10 (diperkenalkan dalam 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (diperkenalkan dalam v1.0)

Konstruktor

PasswordCredential()

Membuat dan menginisialisasi instans baru yang kosong dari objek PasswordCredential .

PasswordCredential(String, String, String)

Membuat dan menginisialisasi instans baru objek PasswordCredential yang berisi data kredensial yang disediakan.

Properti

Password

Mendapatkan atau mengatur string kata sandi kredensial. Nilai ini tidak boleh null atau kosong, jika tidak, pengecualian akan dilemparkan. Anda harus memanggil RetrievePassword terlebih dahulu untuk mengatur nilai awal properti ini.

Properties

API ini ditujukan untuk penggunaan internal saja tidak boleh digunakan dalam kode Anda.

Resource

Mendapatkan atau mengatur sumber daya kredensial.

UserName

Mendapatkan atau mengatur nama pengguna kredensial. Nilai ini tidak boleh null atau kosong, jika tidak, pengecualian akan dilemparkan.

Metode

RetrievePassword()

Mengisi kata sandi untuk kredensial. Setelah operasi berhasil dikembalikan, Anda bisa mendapatkan kata sandi dari properti Kata Sandi .

Berlaku untuk