我有一个密码框,我想获取输入数据以检查验证。对变量使用密码箱的值
我passwordbox C#代码
public void textBox2_TextInput(object sender, TextCompositionEventArgs e)
{
//pass = textBox2.ToString();
}
和XAML代码
<PasswordBox Name="textBox2"
PasswordChar="*"
TextInput="textBox2_TextInput" />
这就是我写捕获密码
private void loginbutton_Click(object sender, RoutedEventArgs e)
{
usr = textBox1.Text;
SecureString passdat =textBox2.SecurePassword;
pass = passdat.ToString();
}
返回null.This是虚拟演示,因此不需要加密。我之前使用了一个文本框,验证工作正常。使用密码b牛只是复杂的东西。
它工作。非常有用的感谢 – 2016-03-18 02:20:18