PasswordPropertyTextAttribute クラス
アセンブリ: System (system.dll 内)

<AttributeUsageAttribute(AttributeTargets.All)> _ Public NotInheritable Class PasswordPropertyTextAttribute Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.All)] public sealed class PasswordPropertyTextAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::All)] public ref class PasswordPropertyTextAttribute sealed : public 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 ReadOnly Property Password() As String Get Return "This is a demo password." End Get End Property
// 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."; } }

System.Attribute
System.ComponentModel.PasswordPropertyTextAttribute


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- PasswordPropertyTextAttribute クラスのページへのリンク