modifypasswordframe.cs
来自「独立完成考勤管理软件加打卡系统(C#) 是打卡加管理系统软件 」· CS 代码 · 共 449 行 · 第 1/2 页
CS
449 行
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace WindowsApplication
{
/// <summary>
/// ModifyPasswordFrame 的摘要说明。
/// </summary>
public class ModifyPasswordFrame : System.Windows.Forms.Form
{
#region 控件声明...
protected System.Windows.Forms.Label titleLabel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox userCom;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.TextBox textRePassword;
private System.Windows.Forms.TextBox textpassword;
private System.Windows.Forms.Button btnCheck;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
#endregion
#region 构造函数...
public ModifyPasswordFrame()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#endregion
#region Windows 窗体设计器生成的代码...
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ModifyPasswordFrame));
this.titleLabel = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.userCom = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.textpassword = new System.Windows.Forms.TextBox();
this.textRePassword = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.btnOk = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnCheck = new System.Windows.Forms.Button();
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.Font = new System.Drawing.Font("宋体", 13F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.titleLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.titleLabel.Location = new System.Drawing.Point(0, 0);
this.titleLabel.Name = "titleLabel";
this.titleLabel.Size = new System.Drawing.Size(312, 40);
this.titleLabel.TabIndex = 0;
this.titleLabel.Text = "修改密码";
this.titleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// 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.SystemColors.ControlText;
this.label1.Location = new System.Drawing.Point(24, 56);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 23);
this.label1.TabIndex = 1;
this.label1.Text = "用户名:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// userCom
//
this.userCom.BackColor = System.Drawing.SystemColors.HighlightText;
this.userCom.Location = new System.Drawing.Point(112, 56);
this.userCom.Name = "userCom";
this.userCom.Size = new System.Drawing.Size(136, 24);
this.userCom.TabIndex = 2;
//
// 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.SystemColors.ControlText;
this.label2.Location = new System.Drawing.Point(24, 104);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(64, 23);
this.label2.TabIndex = 3;
this.label2.Text = "密码:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// textpassword
//
this.textpassword.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.textpassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textpassword.Location = new System.Drawing.Point(112, 104);
this.textpassword.Name = "textpassword";
this.textpassword.PasswordChar = '%';
this.textpassword.Size = new System.Drawing.Size(136, 26);
this.textpassword.TabIndex = 4;
this.textpassword.Text = "";
//
// textRePassword
//
this.textRePassword.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.textRePassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textRePassword.Location = new System.Drawing.Point(112, 152);
this.textRePassword.Name = "textRePassword";
this.textRePassword.PasswordChar = '%';
this.textRePassword.Size = new System.Drawing.Size(136, 26);
this.textRePassword.TabIndex = 6;
this.textRePassword.Text = "";
//
// 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.SystemColors.ControlText;
this.label3.Location = new System.Drawing.Point(24, 152);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(64, 23);
this.label3.TabIndex = 5;
this.label3.Text = "确认码:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnOk
//
this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOk.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnOk.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnOk.Location = new System.Drawing.Point(120, 200);
this.btnOk.Name = "btnOk";
this.btnOk.TabIndex = 7;
this.btnOk.Text = "确认(&O)";
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// btnCancel
//
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.SystemColors.ControlText;
this.btnCancel.Location = new System.Drawing.Point(208, 200);
this.btnCancel.Name = "btnCancel";
this.btnCancel.TabIndex = 8;
this.btnCancel.Text = "取消(&C)";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnCheck
//
this.btnCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCheck.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnCheck.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnCheck.Location = new System.Drawing.Point(32, 200);
this.btnCheck.Name = "btnCheck";
this.btnCheck.TabIndex = 9;
this.btnCheck.Text = "检验(&Y)";
this.btnCheck.Click += new System.EventHandler(this.btnCheck_Click);
//
// ModifyPasswordFrame
//
this.AutoScaleBaseSize = new System.Drawing.Size(9, 19);
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.ClientSize = new System.Drawing.Size(306, 247);
this.Controls.Add(this.btnCheck);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk);
this.Controls.Add(this.textRePassword);
this.Controls.Add(this.label3);
this.Controls.Add(this.textpassword);
this.Controls.Add(this.label2);
this.Controls.Add(this.userCom);
this.Controls.Add(this.label1);
this.Controls.Add(this.titleLabel);
this.Cursor = System.Windows.Forms.Cursors.Hand;
this.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ModifyPasswordFrame";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "ModifyPasswordFrame";
this.Load += new System.EventHandler(this.ModifyPasswordFrame_Load);
this.ResumeLayout(false);
}
#endregion
#region 变量声明...
private string userNameSql="select distinct 用户名称 from System_UserTable";
private ConnectionData conn=new ConnectionData();
private string selectUser="select * from System_UserTable";
#endregion
#region 数据库变量声明...
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?