📄 loginbegin.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Jinrm.Data;
using GzglClient.BLL;
namespace GzglClient
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class LoginBegin : System.Windows.Forms.Form
{
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtPwd;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cbName;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private PinkieControls.ButtonXP btnCanel;
private PinkieControls.ButtonXP btnLogin;
private AllStr _astr = null;
/// <summary>
/// 构造函数
/// </summary>
public LoginBegin()
{
InitializeComponent();
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(LoginBegin));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtPwd = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.cbName = new System.Windows.Forms.ComboBox();
this.btnLogin = new PinkieControls.ButtonXP();
this.btnCanel = new PinkieControls.ButtonXP();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Top;
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(322, 50);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtPwd);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.cbName);
this.groupBox1.Location = new System.Drawing.Point(9, 56);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(304, 96);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
//
// txtPwd
//
this.txtPwd.Location = new System.Drawing.Point(80, 45);
this.txtPwd.Name = "txtPwd";
this.txtPwd.PasswordChar = '*';
this.txtPwd.Size = new System.Drawing.Size(200, 21);
this.txtPwd.TabIndex = 7;
this.txtPwd.Text = "";
//
// label2
//
this.label2.Location = new System.Drawing.Point(24, 53);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(48, 23);
this.label2.TabIndex = 5;
this.label2.Text = "密 码";
//
// label1
//
this.label1.Location = new System.Drawing.Point(24, 29);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 23);
this.label1.TabIndex = 4;
this.label1.Text = "用户名";
//
// cbName
//
this.cbName.Items.AddRange(new object[] {
"管理员"});
this.cbName.Location = new System.Drawing.Point(80, 24);
this.cbName.Name = "cbName";
this.cbName.Size = new System.Drawing.Size(200, 20);
this.cbName.TabIndex = 4;
this.cbName.Text = "管理员";
//
// btnLogin
//
this.btnLogin.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(235)), ((System.Byte)(246)), ((System.Byte)(255)));
this.btnLogin.DefaultScheme = true;
this.btnLogin.DialogResult = System.Windows.Forms.DialogResult.None;
this.btnLogin.Hint = "";
this.btnLogin.Location = new System.Drawing.Point(144, 168);
this.btnLogin.Name = "btnLogin";
this.btnLogin.Scheme = PinkieControls.ButtonXP.Schemes.Blue;
this.btnLogin.Size = new System.Drawing.Size(75, 26);
this.btnLogin.TabIndex = 4;
this.btnLogin.Text = "登录";
this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
//
// btnCanel
//
this.btnCanel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(235)), ((System.Byte)(246)), ((System.Byte)(255)));
this.btnCanel.DefaultScheme = true;
this.btnCanel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCanel.Hint = "";
this.btnCanel.Location = new System.Drawing.Point(224, 168);
this.btnCanel.Name = "btnCanel";
this.btnCanel.Scheme = PinkieControls.ButtonXP.Schemes.Blue;
this.btnCanel.Size = new System.Drawing.Size(75, 26);
this.btnCanel.TabIndex = 4;
this.btnCanel.Text = "取消";
this.btnCanel.Click += new System.EventHandler(this.btnCanel_Click);
//
// LoginBegin
//
this.AcceptButton = this.btnLogin;
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(235)), ((System.Byte)(246)), ((System.Byte)(255)));
this.CancelButton = this.btnCanel;
this.ClientSize = new System.Drawing.Size(322, 203);
this.Controls.Add(this.btnLogin);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.btnCanel);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "LoginBegin";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "用户登录";
this.Load += new System.EventHandler(this.LoginBegin_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void LoginBegin_Load(object sender, System.EventArgs e)
{
}
private void btnLogin_Click(object sender, System.EventArgs e)
{
// DoAccess conn = new DoAccess();
// DataSet ds = conn.GetDs("*","UserInfo","UserName = '"+ txtName.Text +"' and UserPwd = '"+ txtPwd.Text +"' ","");
// if(ds.Tables[0].Rows.Count == 1)
// {
// AllStr.UserId = "1";
// AllStr.UserName = "管理员";
// AllStr.UserPwd = "";
//
//
// MianFrom mf = new MianFrom();
// mf.astr = _astr;
// mf.Show();
// this.Hide();
// }
// else
// {
// MessageBox.Show("你输入的帐号或密码错误!");
// }
}
private void btnCanel_Click(object sender, System.EventArgs e)
{
Application.Exit();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -