📄 form4.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace sqlgood
{
/// <summary>
/// Form4 的摘要说明。
/// </summary>
public class Form4 : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtname;
private System.Windows.Forms.TextBox txtpassword;
private System.Windows.Forms.Button btncansle;
private System.Windows.Forms.Button btnok;
private System.Windows.Forms.Button button1;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
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.SqlConnection sqlConnection1;
private sqlgood.DataSet2 dataSet21;
private System.Windows.Forms.LinkLabel linkLabel2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form4()
{
//
// 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()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnok = new System.Windows.Forms.Button();
this.btncansle = new System.Windows.Forms.Button();
this.txtpassword = new System.Windows.Forms.TextBox();
this.txtname = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlConnection1 = 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.dataSet21 = new sqlgood.DataSet2();
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataSet21)).BeginInit();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.btnok);
this.groupBox1.Controls.Add(this.btncansle);
this.groupBox1.Controls.Add(this.txtpassword);
this.groupBox1.Controls.Add(this.txtname);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.ForeColor = System.Drawing.Color.Blue;
this.groupBox1.Location = new System.Drawing.Point(48, 32);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(208, 200);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// btnok
//
this.btnok.BackColor = System.Drawing.Color.LightCyan;
this.btnok.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnok.ForeColor = System.Drawing.Color.Blue;
this.btnok.Location = new System.Drawing.Point(8, 168);
this.btnok.Name = "btnok";
this.btnok.TabIndex = 3;
this.btnok.Text = "登陆";
this.btnok.Click += new System.EventHandler(this.btnok_Click);
//
// btncansle
//
this.btncansle.BackColor = System.Drawing.Color.LightCyan;
this.btncansle.Cursor = System.Windows.Forms.Cursors.Hand;
this.btncansle.Location = new System.Drawing.Point(120, 168);
this.btncansle.Name = "btncansle";
this.btncansle.TabIndex = 4;
this.btncansle.Text = "取消";
this.btncansle.Click += new System.EventHandler(this.btncansle_Click);
//
// txtpassword
//
this.txtpassword.Location = new System.Drawing.Point(64, 128);
this.txtpassword.Name = "txtpassword";
this.txtpassword.PasswordChar = '*';
this.txtpassword.Size = new System.Drawing.Size(112, 21);
this.txtpassword.TabIndex = 2;
this.txtpassword.Text = "";
//
// txtname
//
this.txtname.Location = new System.Drawing.Point(64, 80);
this.txtname.Name = "txtname";
this.txtname.Size = new System.Drawing.Size(112, 21);
this.txtname.TabIndex = 1;
this.txtname.Text = "";
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 128);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 23);
this.label2.TabIndex = 1;
this.label2.Text = "密码";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 80);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 23);
this.label1.TabIndex = 0;
this.label1.Text = "用户名";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// button1
//
this.button1.BackColor = System.Drawing.Color.LightCyan;
this.button1.Cursor = System.Windows.Forms.Cursors.Hand;
this.button1.ForeColor = System.Drawing.Color.Blue;
this.button1.Location = new System.Drawing.Point(184, 248);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 32);
this.button1.TabIndex = 5;
this.button1.Text = "关闭";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// sqlDataAdapter1
//
this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "goodpass", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("name", "name"),
new System.Data.Common.DataColumnMapping("password", "password"),
new System.Data.Common.DataColumnMapping("unit", "unit")})});
this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
//
// sqlDeleteCommand1
//
this.sqlDeleteCommand1.CommandText = "DELETE FROM goodpass WHERE (name = @Original_name) AND (password = @Original_pass" +
"word OR @Original_password IS NULL AND password IS NULL) AND (unit = @Original_u" +
"nit OR @Original_unit IS NULL AND unit IS NULL)";
this.sqlDeleteCommand1.Connection = this.sqlConnection1;
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_name", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "name", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_password", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "password", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_unit", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "unit", System.Data.DataRowVersion.Original, null));
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "workstation id=HOUHAIPO1;packet size=4096;integrated security=SSPI;data source=\"." +
"\";persist security info=False;initial catalog=sqlgoods";
//
// sqlInsertCommand1
//
this.sqlInsertCommand1.CommandText = "INSERT INTO goodpass(name, password, unit) VALUES (@name, @password, @unit); SELE" +
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -