SecurePassword Property

PasswordBox.SecurePassword Property


Gets the password currently held by the PasswordBox as a SecureString.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public SecureString SecurePassword { get; }

Property Value

Type: System.Security.SecureString

A secure string representing the password currently held by the PasswordBox.

When you get the Password property value, you expose the password as plain text in memory. To avoid this potential security risk, use the SecurePassword property to get the password as a SecureString.

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft