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 フォーム コントロールで属性を適用する」を参照してください。

// 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
{
    get
    {
        return "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 プロパティまたは型に配置されている場合、プロパティ ウィンドウ内のテキスト表現は、パスワード フィールドを示すドットまたはアスタリスクとして表示されます。

注意事項

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

コンストラクター

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)

適用対象