PasswordPropertyTextAttribute Kelas

Definisi

Menunjukkan bahwa representasi teks objek dikaburkan oleh karakter seperti tanda bintang. Kelas ini tidak dapat diwariskan.

public ref class PasswordPropertyTextAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.All)]
public sealed class PasswordPropertyTextAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.All)>]
type PasswordPropertyTextAttribute = class
    inherit Attribute
Public NotInheritable Class PasswordPropertyTextAttribute
Inherits Attribute
Warisan
PasswordPropertyTextAttribute
Atribut

Contoh

Contoh kode berikut menunjukkan menggunakan PasswordPropertyTextAttribute untuk mengaburkan nilai properti string dalam PropertyGrid kontrol. Untuk daftar kode lengkap, lihat Cara: Terapkan Atribut di Kontrol Windows Forms.

// This property exists only to demonstrate the
// PasswordPropertyText attribute. When this control
// is attached to a PropertyGrid control, the returned
// string will be displayed with obscuring characters
// such as asterisks. This property has no other effect.
[Category("Security")]
[Description("Demonstrates PasswordPropertyTextAttribute.")]
[PasswordPropertyText(true)]
public string Password => "This is a demo password.";
' This property exists only to demonstrate the 
' PasswordPropertyText attribute. When this control 
' is attached to a PropertyGrid control, the returned 
' string will be displayed with obscuring characters
' such as asterisks. This property has no other effect.
<Category("Security"), _
Description("Demonstrates PasswordPropertyTextAttribute."), _
PasswordPropertyText(True)> _
Public ReadOnly Property Password() As String
    Get
        Return "This is a demo password."
    End Get
End Property

Keterangan

PasswordPropertyTextAttribute Jika atribut ditempatkan pada properti atau jenis, representasi teksnya di jendela properti muncul sebagai titik atau tanda bintang untuk menunjukkan bidang kata sandi.

Perhatian

Indikasi ini sama sekali tidak mewakili semua jenis enkripsi atau keamanan. Untuk informasi selengkapnya tentang menggunakan atribut, lihat Atribut.

Konstruktor

Nama Deskripsi
PasswordPropertyTextAttribute()

Menginisialisasi instans baru dari kelas PasswordPropertyTextAttribute.

PasswordPropertyTextAttribute(Boolean)

Menginisialisasi instans PasswordPropertyTextAttribute baru kelas, secara opsional memperlihatkan teks kata sandi.

Bidang

Nama Deskripsi
Default

Menentukan nilai default untuk PasswordPropertyTextAttribute.

No

Menentukan bahwa properti teks tidak digunakan sebagai kata sandi. Bidang (Shared di Visual Basic) ini static bersifat baca-saja.

Yes

Menentukan bahwa properti teks digunakan sebagai kata sandi. Bidang (Shared di Visual Basic) ini static bersifat baca-saja.

Properti

Nama Deskripsi
Password

Mendapatkan nilai yang menunjukkan apakah properti yang PasswordPropertyTextAttribute ditentukan harus ditampilkan sebagai teks kata sandi.

TypeId

Ketika diimplementasikan dalam kelas turunan, mendapatkan pengidentifikasi unik untuk Attributeini.

(Diperoleh dari Attribute)

Metode

Nama Deskripsi
Equals(Object)

Menentukan apakah dua PasswordPropertyTextAttribute instans sama.

GetHashCode()

Mengembalikan kode hash untuk instans ini.

GetType()

Mendapatkan Type instans saat ini.

(Diperoleh dari Object)
IsDefaultAttribute()

Mengembalikan indikasi apakah nilai instans ini adalah nilai default.

Match(Object)

Saat ditimpa dalam kelas turunan, mengembalikan nilai yang menunjukkan apakah instans ini sama dengan objek tertentu.

(Diperoleh dari Attribute)
MemberwiseClone()

Membuat salinan dangkal dari Objectsaat ini.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Implementasi Antarmuka Eksplisit

Nama Deskripsi
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Memetakan sekumpulan nama ke sekumpulan pengidentifikasi pengiriman yang sesuai.

(Diperoleh dari Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Mengambil informasi jenis untuk objek, yang dapat digunakan untuk mendapatkan informasi jenis untuk antarmuka.

(Diperoleh dari Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Mengambil jumlah antarmuka informasi jenis yang disediakan objek (baik 0 atau 1).

(Diperoleh dari Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Menyediakan akses ke properti dan metode yang diekspos oleh objek.

(Diperoleh dari Attribute)

Berlaku untuk