This commit is contained in:
sc authored and sc committed 2022-05-17 16:27:02 +08:00
commit f7e064070c
112 files changed
+2233 -7508

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
<Window x:Class="Audit.Windows.user"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Audit.Windows"
mc:Ignorable="d"
Title="用户登录" Height="200" Width="300" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
<Grid>
<TextBlock HorizontalAlignment="Left" Height="25" Margin="55,30,0,0" TextWrapping="Wrap" Text="用户" VerticalAlignment="Top" Width="35" FontSize="16"/>
<TextBlock HorizontalAlignment="Left" Height="25" Margin="55,60,0,0" TextWrapping="Wrap" Text="密码" VerticalAlignment="Top" Width="35" FontSize="16"/>
<TextBlock HorizontalAlignment="Left" Height="25" Margin="55,130,0,0" TextWrapping="Wrap" Text="时间" VerticalAlignment="Top" Width="35" FontSize="16"/>
<TextBox HorizontalAlignment="Left" Height="25" Margin="90,130,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" x:Name="userst" IsTabStop="True"
BorderBrush="{x:Null}" Text="600" InputMethod.IsInputMethodEnabled="False" />
<TextBox HorizontalAlignment="Left" Height="25" Margin="90,30,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" x:Name="users" IsTabStop="True"/>
<TextBox HorizontalAlignment="Left" Height="25" Margin="90,60,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" x:Name="Passwds" IsTabStop="True"/>
<Button HorizontalAlignment="Left" Height="35" Margin="60,90,0,0" VerticalAlignment="Top" Content="登录" Width="75" Click="Log" FontSize="16"/>
<Button HorizontalAlignment="Left" Height="35" Margin="165,90,0,0" VerticalAlignment="Top" Content="取消" Width="75" Click="Exit" FontSize="16"/>
</Grid>
</Window>
+64
View File
@@ -0,0 +1,64 @@
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:拒绝登录", "错误");//设置密码错误
}
}
}
}