private void btnLogin_Click(object sender, RoutedEventArgs e) { if (txtLogPwd.Password == "" && txtLogId.Text == "") { nameZC.Content = "注册名:"; pwdZC.Content = "注册密码"; MessageBox.Show("转成注册界面"); return; } Admins admins = new Admins(); admins.LoginPwd = txtLogPwd.Password; admins.AdminName = txtLogId.Text; Manager.AddAdmins(admins); MessageBox.Show("注册成功"); nameZC.Content = "登录账号:"; pwdZC.Content = "登录密码:"; }