PasswordPropertyTextAttribute クラス

定義

オブジェクトのテキスト表現がアスタリスクなどの文字で隠されることを示します。 このクラスは継承できません。

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
継承
PasswordPropertyTextAttribute
属性

次のコード例は、 PasswordPropertyTextAttribute を使用して、 PropertyGrid コントロールの文字列プロパティの値を隠す方法を示しています。 完全なコード一覧については、「方法: 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

注釈

PasswordPropertyTextAttribute属性がプロパティまたは型に配置されている場合、プロパティ ウィンドウ内のテキスト表現は、パスワード フィールドを示すドットまたはアスタリスクとして表示されます。

Caution

この兆候は、いかなる種類の暗号化やセキュリティも表しません。 属性の使用の詳細については、「 属性」を参照してください。

コンストラクター

名前 説明
PasswordPropertyTextAttribute()

PasswordPropertyTextAttribute クラスの新しいインスタンスを初期化します。

PasswordPropertyTextAttribute(Boolean)

必要に応じてパスワード テキストを表示して、 PasswordPropertyTextAttribute クラスの新しいインスタンスを初期化します。

フィールド

名前 説明
Default

PasswordPropertyTextAttributeの既定値を指定します。

No

テキスト プロパティをパスワードとして使用しないことを指定します。 この static (Visual Basic のShared ) フィールドは読み取り専用です。

Yes

テキスト プロパティをパスワードとして使用することを指定します。 この static (Visual Basic のShared ) フィールドは読み取り専用です。

プロパティ

名前 説明
Password

PasswordPropertyTextAttributeが定義されているプロパティをパスワード テキストとして表示するかどうかを示す値を取得します。

TypeId

派生クラスで実装されている場合は、この Attributeの一意の識別子を取得します。

(継承元 Attribute)

メソッド

名前 説明
Equals(Object)

2 つの PasswordPropertyTextAttribute インスタンスが等しいかどうかを判断します。

GetHashCode()

このインスタンスのハッシュ コードを返します。

GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

このインスタンスの値が既定値かどうかを示す値を返します。

Match(Object)

派生クラスでオーバーライドされた場合、このインスタンスが指定したオブジェクトと等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

名前 説明
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

インターフェイスの型情報を取得するために使用できるオブジェクトの型情報を取得します。

(継承元 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されるプロパティとメソッドへのアクセスを提供します。

(継承元 Attribute)

適用対象