就是画面中有一个退出按钮,怎么点它的时候需要输入密码才能退出运行系统?

你怎么写的那个代码?

private void button1_Click(object sender, RoutedEventArgs e)
{
if (textBox1.Text == "123")
{
Application.Current.MainWindow.Close();
}
else
{
string message = "请输入密码,然后再退出窗体...";
MessageBox.Show(message, "温馨提示你", MessageBoxButton.OK);
textBox1.Focus();
}
}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-06-26
直接按大屏幕右上的关闭就行了
相似回答