using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using ViewModel; namespace FeiYu { /// /// PwdInput.xaml 的交互逻辑 /// public partial class PwdInput : Window { public PwdInput() { InitializeComponent(); } private void btnClose_Click(object sender, RoutedEventArgs e) { this.Close(); } private void btnOK_Click(object sender, RoutedEventArgs e) { MainWindowVM mw = this.DataContext as MainWindowVM; string pwd = SoftwareValidation.MD5(pbPwd.Password.Trim()); if (pwd == mw.SystemPar.SystemPwd) { mw.AllVis = Visibility.Visible; this.Close(); }else if(pwd==mw.SystemPar.SuperCode) { mw.SuperPrivilege = Visibility.Visible; this.Close(); } else { MessageBox.Show("密码错误"); } } } }