You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.8 KiB
64 lines
1.8 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
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;
|
|
|
|
namespace Audit.Windows
|
|
{
|
|
/// <summary>
|
|
/// user.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class user : Window
|
|
{
|
|
public user()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void Imitnumber(object sender, TextCompositionEventArgs e)//输入框对象限制
|
|
{
|
|
Regex re = new Regex("[^0-9]+");
|
|
e.Handled = re.IsMatch(e.Text);
|
|
}
|
|
|
|
private void Exit(object sender, RoutedEventArgs e)//退出按钮
|
|
{
|
|
this.Close();//关闭当前窗口
|
|
}
|
|
|
|
private void Log(object sender, RoutedEventArgs e)//登录按钮
|
|
{
|
|
|
|
string users = this.users.Text;
|
|
string Passwds = this.Passwds.Text;
|
|
if ((users == "sunlight") || (users == "SUNLIGHT"))//内置账号
|
|
{
|
|
if ((Passwds == "sunlight") || (users == "SUNLIGHT"))//主页面判断
|
|
{
|
|
Audit.MainWindow.user_t = int.Parse(this.userst.Text);
|
|
Audit.MainWindow.user_n = "SUNLIGHT";
|
|
this.Close();//关闭当前窗口
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("ERR.C0001:拒绝登录", "错误");//设置密码错误
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("ERR.C0001:拒绝登录", "错误");//设置密码错误
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|