客户端实现:login
namespace LoginApp { partial class Form1 { /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows 窗体设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.txtPwd = new System.Windows.Forms.TextBox(); this.txtUserName = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.btnClose = new System.Windows.Forms.Button(); this.btnLogin = new System.Windows.Forms.Button(); this.SuspendLayout(); // // txtPwd // this.txtPwd.Location = new System.Drawing.Point(191, 100); this.txtPwd.Margin = new System.Windows.Forms.Padding(4); this.txtPwd.Name = "txtPwd"; this.txtPwd.PasswordChar = '*'; this.txtPwd.Size = new System.Drawing.Size(124, 25); this.txtPwd.TabIndex = 11; this.txtPwd.Text = "admin"; // // txtUserName // this.txtUserName.Location = new System.Drawing.Point(191, 55); this.txtUserName.Margin = new System.Windows.Forms.Padding(4); this.txtUserName.Name = "txtUserName"; this.txtUserName.Size = new System.Drawing.Size(124, 25); this.txtUserName.TabIndex = 10; this.txtUserName.Text = "admin"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(78, 100); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(37, 15); this.label2.TabIndex = 9; this.label2.Text = "密码"; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(78, 55); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(52, 15); this.label1.TabIndex = 8; this.label1.Text = "用户名"; // // btnClose // this.btnClose.Location = new System.Drawing.Point(207, 168); this.btnClose.Margin = new System.Windows.Forms.Padding(4); this.btnClose.Name = "btnClose"; this.btnClose.Size = new System.Drawing.Size(125, 29); this.btnClose.TabIndex = 7; this.btnClose.Text = "关闭"; this.btnClose.UseVisualStyleBackColor = true; this.btnClose.Click += new System.EventHandler(this.btnClose_Click); // // btnLogin // this.btnLogin.Location = new System.Drawing.Point(55, 168); this.btnLogin.Margin = new System.Windows.Forms.Padding(4); this.btnLogin.Name = "btnLogin"; this.btnLogin.Size = new System.Drawing.Size(125, 29); this.btnLogin.TabIndex = 6; this.btnLogin.Text = "登录"; this.btnLogin.UseVisualStyleBackColor = true; this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(387, 253); this.Controls.Add(this.txtPwd); this.Controls.Add(this.txtUserName); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.btnClose); this.Controls.Add(this.btnLogin); this.Name = "Form1"; this.Text = "登录"; this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.TextBox txtPwd; private System.Windows.Forms.TextBox txtUserName; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button btnClose; private System.Windows.Forms.Button btnLogin; } }