PasswordBox.SecurePassword Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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
Show: