Form_Welcome.cs
上传用户:chinapurv
上传日期:2014-03-12
资源大小:4870k
文件大小:4k
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Data.OleDb;
- namespace 图书管理系统
- {
- /// <summary>
- /// Form_Welcome 的摘要说明。
- /// </summary>
- public class Form_Welcome : System.Windows.Forms.Form
- {
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.TextBox textPassword;
- private System.Windows.Forms.Button butsubmit;
- /// <summary>
- /// 必需的设计器变量。
- /// </summary>
- private System.ComponentModel.Container components = null;
- public Form_Welcome()
- {
- //
- // Windows 窗体设计器支持所必需的
- //
- InitializeComponent();
- //
- // TODO: 在 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(Form_Welcome));
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.textPassword = new System.Windows.Forms.TextBox();
- this.butsubmit = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // label1
- //
- this.label1.BackColor = System.Drawing.Color.Transparent;
- this.label1.Font = new System.Drawing.Font("宋体", 48F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
- this.label1.Location = new System.Drawing.Point(12, 15);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(448, 313);
- this.label1.TabIndex = 1;
- this.label1.Text = "欢迎使用Smart Wholesaler 购书系统";
- this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // label2
- //
- this.label2.BackColor = System.Drawing.Color.Transparent;
- this.label2.Location = new System.Drawing.Point(80, 352);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(64, 16);
- this.label2.TabIndex = 2;
- this.label2.Text = "登录密码:";
- //
- // textPassword
- //
- this.textPassword.Location = new System.Drawing.Point(144, 344);
- this.textPassword.Name = "textPassword";
- this.textPassword.PasswordChar = '*';
- this.textPassword.Size = new System.Drawing.Size(184, 21);
- this.textPassword.TabIndex = 3;
- this.textPassword.Text = "";
- //
- // butsubmit
- //
- this.butsubmit.BackColor = System.Drawing.Color.Transparent;
- this.butsubmit.Location = new System.Drawing.Point(344, 344);
- this.butsubmit.Name = "butsubmit";
- this.butsubmit.Size = new System.Drawing.Size(48, 24);
- this.butsubmit.TabIndex = 4;
- this.butsubmit.Text = "登录";
- this.butsubmit.Click += new System.EventHandler(this.butsubmit_Click);
- //
- // Form_Welcome
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
- this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
- this.ClientSize = new System.Drawing.Size(472, 382);
- this.Controls.Add(this.butsubmit);
- this.Controls.Add(this.textPassword);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.label1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- this.Name = "Form_Welcome";
- this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- this.Text = "Form_Welcome";
- this.ResumeLayout(false);
- }
- #endregion
- static public bool submit=false;
- private void butsubmit_Click(object sender, System.EventArgs e)
- {
- if(textPassword.Text=="123")
- {
- submit=true;
- MessageBox.Show("恭喜,登录成功!","提示");
- label2.Visible=false;
- textPassword.Visible=false;
- butsubmit.Visible=false;
- }
- else
- {
- textPassword.Text="";
- MessageBox.Show("密码错误,无法登录系统!","提示");
- textPassword.Focus();
- }
- }
- }
- }