WPF中的密码框
XAML文件
<PasswordBox Name="PasswordBox" Margin="5" Padding="5" PreviewKeyDown="Txtpassword_PreviewKeyUp"/>
后台代码:
IntPtr p = System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this.PasswordBox.SecurePassword); string password = System.Runtime.InteropServices.Marshal.PtrToStringBSTR(p);
标签:System,InteropServices,密码,WPF,Runtime,Marshal From: https://www.cnblogs.com/niunan/p/17445963.html