MaskedTextProvider.ToString Method (Boolean)

Returns the formatted string, optionally including password characters.

Namespace:  System.ComponentModel
Assembly:  System (in System.dll)

public string ToString(
	bool ignorePasswordChar
)

Parameters

ignorePasswordChar
Type: System.Boolean

true to return the actual editable characters; otherwise, false to indicate that the PasswordChar property is to be honored.

Return Value

Type: System.String
The formatted String that includes literals, prompts, and optionally password characters.

This version of the overloaded ToString method includes prompts and literals according to the current values of the IncludePrompt and IncludeLiterals properties, respectively. If the ignorePasswordChar parameter is true, it will return the original input characters, ignoring the value of the PasswordChar property. If this parameter is false, it will use the password character to obscure editable user input if the PasswordChar property is set to a value other than null.

Important noteImportant

Because this method potentially reveals information that is usually protected in the user interface by password characters, it should be used with extreme caution to avoid accidentally revealing sensitive user data.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft