客户端界面效果图:
2.客户端功能实现
一:窗体代码
namespace WriteCard { partial class FrmCard { /// <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.btnCard = new System.Windows.Forms.Button(); this.txtCardNo = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.lblShuaCardtime = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.label8 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.txtSchool = new System.Windows.Forms.TextBox(); this.txtIDCard = new System.Windows.Forms.TextBox(); this.txtPosition = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.txtClass = new System.Windows.Forms.TextBox(); this.txtSex = new System.Windows.Forms.TextBox(); this.txtName = new System.Windows.Forms.TextBox(); this.txtCard = new System.Windows.Forms.TextBox(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.信息设置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBox1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // // btnCard // this.btnCard.Location = new System.Drawing.Point(301, 39); this.btnCard.Name = "btnCard"; this.btnCard.Size = new System.Drawing.Size(75, 23); this.btnCard.TabIndex = 0; this.btnCard.Text = "刷卡"; this.btnCard.UseVisualStyleBackColor = true; this.btnCard.Click += new System.EventHandler(this.btnCard_Click); // // txtCardNo // this.txtCardNo.Location = new System.Drawing.Point(78, 39); this.txtCardNo.Name = "txtCardNo"; this.txtCardNo.Size = new System.Drawing.Size(205, 21); this.txtCardNo.TabIndex = 1; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(29, 42); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(41, 12); this.label1.TabIndex = 7; this.label1.Text = "卡号:"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(29, 66); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(65, 12); this.label2.TabIndex = 8; this.label2.Text = "刷卡时间:"; // // lblShuaCardtime // this.lblShuaCardtime.AutoSize = true; this.lblShuaCardtime.Location = new System.Drawing.Point(100, 66); this.lblShuaCardtime.Name = "lblShuaCardtime"; this.lblShuaCardtime.Size = new System.Drawing.Size(41, 12); this.lblShuaCardtime.TabIndex = 9; this.lblShuaCardtime.Text = "******"; // // groupBox1 // this.groupBox1.Controls.Add(this.label8); this.groupBox1.Controls.Add(this.label9); this.groupBox1.Controls.Add(this.label10); this.groupBox1.Controls.Add(this.txtSchool); this.groupBox1.Controls.Add(this.txtIDCard); this.groupBox1.Controls.Add(this.txtPosition); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.label6); this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.txtClass); this.groupBox1.Controls.Add(this.txtSex); this.groupBox1.Controls.Add(this.txtName); this.groupBox1.Controls.Add(this.txtCard); this.groupBox1.Location = new System.Drawing.Point(31, 87); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(252, 228); this.groupBox1.TabIndex = 13; this.groupBox1.TabStop = false; this.groupBox1.Text = "人员信息"; // // label8 // this.label8.AutoSize = true; this.label8.Location = new System.Drawing.Point(8, 192); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(65, 12); this.label8.TabIndex = 27; this.label8.Text = "所属学校:"; // // label9 // this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(10, 163); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(65, 12); this.label9.TabIndex = 26; this.label9.Text = "身份证号:"; // // label10 // this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(22, 136); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(41, 12); this.label10.TabIndex = 25; this.label10.Text = "职称:"; // // txtSchool // this.txtSchool.Location = new System.Drawing.Point(71, 187); this.txtSchool.Name = "txtSchool"; this.txtSchool.Size = new System.Drawing.Size(159, 21); this.txtSchool.TabIndex = 23; // // txtIDCard // this.txtIDCard.Location = new System.Drawing.Point(71, 160); this.txtIDCard.Name = "txtIDCard"; this.txtIDCard.Size = new System.Drawing.Size(159, 21); this.txtIDCard.TabIndex = 22; // // txtPosition // this.txtPosition.Location = new System.Drawing.Point(71, 133); this.txtPosition.Name = "txtPosition"; this.txtPosition.Size = new System.Drawing.Size(159, 21); this.txtPosition.TabIndex = 21; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(19, 106); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(41, 12); this.label3.TabIndex = 20; this.label3.Text = "班级:"; // // label6 // this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(22, 81); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(35, 12); this.label6.TabIndex = 19; this.label6.Text = "性别:"; // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(22, 52); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(41, 12); this.label5.TabIndex = 18; this.label5.Text = "姓名:"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(22, 25); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(41, 12); this.label4.TabIndex = 17; this.label4.Text = "卡号:"; // // txtClass // this.txtClass.Location = new System.Drawing.Point(71, 103); this.txtClass.Name = "txtClass"; this.txtClass.Size = new System.Drawing.Size(159, 21); this.txtClass.TabIndex = 16; // // txtSex // this.txtSex.Location = new System.Drawing.Point(71, 76); this.txtSex.Name = "txtSex"; this.txtSex.Size = new System.Drawing.Size(159, 21); this.txtSex.TabIndex = 15; // // txtName // this.txtName.Location = new System.Drawing.Point(71, 49); this.txtName.Name = "txtName"; this.txtName.Size = new System.Drawing.Size(159, 21); this.txtName.TabIndex = 14; // // txtCard // this.txtCard.Location = new System.Drawing.Point(71, 22); this.txtCard.Name = "txtCard"; this.txtCard.Size = new System.Drawing.Size(159, 21); this.txtCard.TabIndex = 13; // // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.信息设置ToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(380, 24); this.menuStrip1.TabIndex = 14; this.menuStrip1.Text = "menuStrip1"; // // 信息设置ToolStripMenuItem // this.信息设置ToolStripMenuItem.Name = "信息设置ToolStripMenuItem"; this.信息设置ToolStripMenuItem.Size = new System.Drawing.Size(65, 20); this.信息设置ToolStripMenuItem.Text = "信息设置"; // // FrmCard // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(380, 322); this.Controls.Add(this.groupBox1); this.Controls.Add(this.lblShuaCardtime); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.txtCardNo); this.Controls.Add(this.btnCard); this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; this.Name = "FrmCard"; this.Text = "IC卡考勤刷卡"; this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Button btnCard; private System.Windows.Forms.TextBox txtCardNo; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label lblShuaCardtime; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox txtClass; private System.Windows.Forms.TextBox txtSex; private System.Windows.Forms.TextBox txtName; private System.Windows.Forms.TextBox txtCard; private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label10; private System.Windows.Forms.TextBox txtSchool; private System.Windows.Forms.TextBox txtIDCard; private System.Windows.Forms.TextBox txtPosition; private System.Windows.Forms.Label label3; private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem 信息设置ToolStripMenuItem; } }