📄 landframe.cs
字号:
#region Named Place
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.IO;
using System.Security.Cryptography;
using System.Security;
using WindowsApplication.dealTime;
#endregion
namespace WindowsApplication
{
#region Main Class
public class landFrame : System.Windows.Forms.Form
{
#region 控件声明...
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
public string strConnection="Workstation ID=localhost;Integrated security=SSPI;DataBase=SystemODBC;";
public System.Data.DataSet ds=new DataSet();
public user UserName=new user();
public toMD5 md5=new toMD5();
public System.Data.DataTable dsTable=new DataTable();
private System.Windows.Forms.RadioButton radioUser;
private System.Windows.Forms.RadioButton radioAdmin;
protected System.Windows.Forms.TextBox textUserPassword;
protected System.Windows.Forms.Button btnLogin;
public System.Windows.Forms.Button btnCancel;
public System.Windows.Forms.Button btnZhuChe;
public System.Windows.Forms.Label TitleLabel;
private string path=System.Environment.CurrentDirectory+"//login.dll";
private System.ComponentModel.IContainer components;
#endregion
#region 声明变量...
#region 用户类型...
public string userTypeStr="";
#endregion
public static string strName="";
public static string strPassword="";
public static string strUserType="";
public static bool blTure=false;//是否登陆成功
public static string strUserName="";
//保存鼠标坐标位置...移动标志...
private int MouseX,MouseY;
private bool blMove=false;
//标是否出现导航栏...
public static bool blM=false;
//显示工具栏变量
public static bool blTool=false;
public static bool blStauts=false;
public static string strUser="";
public static string strAdmin="";
#endregion
#region 数据库变量
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox textUserDate;
private System.Windows.Forms.Timer currentTime;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox textBox1;
public System.Windows.Forms.Label label4;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.Label userLabel;
private System.Windows.Forms.Label dateLabel;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter;
private System.Data.SqlClient.SqlConnection sqlConnection;
private WindowsApplication.userdengluSet userdengluSet;
private System.Windows.Forms.ContextMenu context;
private System.Windows.Forms.MenuItem menuDengLuHistory;
private System.Windows.Forms.ToolTip tool;
private System.Windows.Forms.ComboBox textUserName;
#endregion
#region 类构结函数
public landFrame()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#endregion
#region 外变量...
private Hashtable userHashTable=new Hashtable();
private static int blDeLu=0;
#endregion
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(landFrame));
this.TitleLabel = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textUserPassword = new System.Windows.Forms.TextBox();
this.radioUser = new System.Windows.Forms.RadioButton();
this.radioAdmin = new System.Windows.Forms.RadioButton();
this.btnLogin = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnZhuChe = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.textUserName = new System.Windows.Forms.ComboBox();
this.textUserDate = new System.Windows.Forms.ComboBox();
this.currentTime = new System.Windows.Forms.Timer(this.components);
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.userLabel = new System.Windows.Forms.Label();
this.dateLabel = new System.Windows.Forms.Label();
this.sqlDataAdapter = new System.Data.SqlClient.SqlDataAdapter();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlConnection = new System.Data.SqlClient.SqlConnection();
this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
this.userdengluSet = new WindowsApplication.userdengluSet();
this.context = new System.Windows.Forms.ContextMenu();
this.menuDengLuHistory = new System.Windows.Forms.MenuItem();
this.tool = new System.Windows.Forms.ToolTip(this.components);
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.userdengluSet)).BeginInit();
this.SuspendLayout();
//
// TitleLabel
//
this.TitleLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TitleLabel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.TitleLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.TitleLabel.Cursor = System.Windows.Forms.Cursors.SizeAll;
this.TitleLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.TitleLabel.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.TitleLabel.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.TitleLabel.Location = new System.Drawing.Point(0, 0);
this.TitleLabel.Name = "TitleLabel";
this.TitleLabel.Size = new System.Drawing.Size(426, 32);
this.TitleLabel.TabIndex = 0;
this.TitleLabel.Text = "登录窗体";
this.TitleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.tool.SetToolTip(this.TitleLabel, "右键导入历史...");
this.TitleLabel.Click += new System.EventHandler(this.TitleLabel_Click);
this.TitleLabel.MouseEnter += new System.EventHandler(this.TitleLabel_MouseEnter);
this.TitleLabel.MouseUp += new System.Windows.Forms.MouseEventHandler(this.TitleLabel_MouseUp);
this.TitleLabel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.TitleLabel_MouseMove);
this.TitleLabel.MouseLeave += new System.EventHandler(this.TitleLabel_MouseLeave);
this.TitleLabel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TitleLabel_MouseDown);
//
// label2
//
this.label2.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label2.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.label2.Location = new System.Drawing.Point(160, 48);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(72, 24);
this.label2.TabIndex = 1;
this.label2.Text = "用户名:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.tool.SetToolTip(this.label2, "右键导入历史...");
//
// label3
//
this.label3.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label3.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.label3.Location = new System.Drawing.Point(160, 96);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(72, 24);
this.label3.TabIndex = 2;
this.label3.Text = "密码:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.tool.SetToolTip(this.label3, "右键导入历史...");
//
// textUserPassword
//
this.textUserPassword.BackColor = System.Drawing.Color.White;
this.textUserPassword.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textUserPassword.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.textUserPassword.Location = new System.Drawing.Point(256, 96);
this.textUserPassword.Name = "textUserPassword";
this.textUserPassword.PasswordChar = '@';
this.textUserPassword.Size = new System.Drawing.Size(128, 21);
this.textUserPassword.TabIndex = 4;
this.textUserPassword.Text = "";
this.tool.SetToolTip(this.textUserPassword, "右键导入历史...");
this.textUserPassword.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textUserPassword_KeyDown);
this.textUserPassword.MouseEnter += new System.EventHandler(this.textUserPassword_MouseEnter);
this.textUserPassword.MouseLeave += new System.EventHandler(this.textUserPassword_MouseLeave);
this.textUserPassword.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textUserPassword_KeyUp);
//
// radioUser
//
this.radioUser.Cursor = System.Windows.Forms.Cursors.Hand;
this.radioUser.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.radioUser.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.radioUser.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.radioUser.Location = new System.Drawing.Point(160, 192);
this.radioUser.Name = "radioUser";
this.radioUser.Size = new System.Drawing.Size(96, 24);
this.radioUser.TabIndex = 5;
this.radioUser.Text = "普通用户";
this.radioUser.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.tool.SetToolTip(this.radioUser, "右键导入历史...");
this.radioUser.MouseEnter += new System.EventHandler(this.radioUser_MouseEnter);
this.radioUser.MouseLeave += new System.EventHandler(this.radioUser_MouseLeave);
this.radioUser.CheckedChanged += new System.EventHandler(this.radioUser_CheckedChanged);
//
// radioAdmin
//
this.radioAdmin.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.radioAdmin.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.radioAdmin.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.radioAdmin.Location = new System.Drawing.Point(304, 192);
this.radioAdmin.Name = "radioAdmin";
this.radioAdmin.Size = new System.Drawing.Size(96, 24);
this.radioAdmin.TabIndex = 6;
this.radioAdmin.Text = "管理员";
this.radioAdmin.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.tool.SetToolTip(this.radioAdmin, "右键导入历史...");
this.radioAdmin.MouseEnter += new System.EventHandler(this.radioAdmin_MouseEnter);
this.radioAdmin.MouseLeave += new System.EventHandler(this.radioAdmin_MouseLeave);
this.radioAdmin.CheckedChanged += new System.EventHandler(this.radioAdmin_CheckedChanged);
//
// btnLogin
//
this.btnLogin.BackColor = System.Drawing.Color.White;
this.btnLogin.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLogin.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnLogin.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.btnLogin.Location = new System.Drawing.Point(248, 232);
this.btnLogin.Name = "btnLogin";
this.btnLogin.Size = new System.Drawing.Size(75, 24);
this.btnLogin.TabIndex = 7;
this.btnLogin.Text = "登录(&L)";
this.tool.SetToolTip(this.btnLogin, "右键导入历史...");
this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
this.btnLogin.MouseEnter += new System.EventHandler(this.btnLogin_MouseEnter);
this.btnLogin.MouseLeave += new System.EventHandler(this.btnLogin_MouseLeave);
//
// btnCancel
//
this.btnCancel.BackColor = System.Drawing.Color.White;
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnCancel.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.btnCancel.Location = new System.Drawing.Point(344, 232);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 24);
this.btnCancel.TabIndex = 8;
this.btnCancel.Text = "取消(&C)";
this.tool.SetToolTip(this.btnCancel, "右键导入历史...");
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
this.btnCancel.MouseEnter += new System.EventHandler(this.btnCancel_MouseEnter);
this.btnCancel.MouseLeave += new System.EventHandler(this.btnCancel_MouseLeave);
//
// btnZhuChe
//
this.btnZhuChe.BackColor = System.Drawing.Color.White;
this.btnZhuChe.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnZhuChe.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnZhuChe.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.btnZhuChe.Location = new System.Drawing.Point(152, 232);
this.btnZhuChe.Name = "btnZhuChe";
this.btnZhuChe.Size = new System.Drawing.Size(75, 24);
this.btnZhuChe.TabIndex = 9;
this.btnZhuChe.Text = "注册(&E)";
this.btnZhuChe.Click += new System.EventHandler(this.btnZhuChe_Click);
this.btnZhuChe.MouseEnter += new System.EventHandler(this.btnZhuChe_MouseEnter);
this.btnZhuChe.MouseLeave += new System.EventHandler(this.btnZhuChe_MouseLeave);
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.label1.Location = new System.Drawing.Point(160, 144);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 24);
this.label1.TabIndex = 11;
this.label1.Text = "日期:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.tool.SetToolTip(this.label1, "右键导入历史...");
//
// textUserName
//
this.textUserName.BackColor = System.Drawing.Color.White;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -