📄 smartcard.cs
字号:
this.RBT.ReadOnly = true;
this.RBT.Size = new System.Drawing.Size(336, 20);
this.RBT.TabIndex = 30;
this.RBT.Text = "";
//
// RBI
//
this.RBI.Location = new System.Drawing.Point(60, 65);
this.RBI.Name = "RBI";
this.RBI.ReadOnly = true;
this.RBI.Size = new System.Drawing.Size(336, 20);
this.RBI.TabIndex = 29;
this.RBI.Text = "";
//
// RBA
//
this.RBA.Location = new System.Drawing.Point(60, 38);
this.RBA.Name = "RBA";
this.RBA.ReadOnly = true;
this.RBA.Size = new System.Drawing.Size(336, 20);
this.RBA.TabIndex = 28;
this.RBA.Text = "";
//
// RBN
//
this.RBN.Location = new System.Drawing.Point(60, 14);
this.RBN.Name = "RBN";
this.RBN.ReadOnly = true;
this.RBN.Size = new System.Drawing.Size(336, 20);
this.RBN.TabIndex = 27;
this.RBN.Text = "";
this.RBN.TextChanged += new System.EventHandler(this.RBN_TextChanged);
//
// label15
//
this.label15.Location = new System.Drawing.Point(6, 137);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(71, 32);
this.label15.TabIndex = 26;
this.label15.Text = "Published Year";
//
// label16
//
this.label16.Location = new System.Drawing.Point(6, 114);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(71, 13);
this.label16.TabIndex = 25;
this.label16.Text = "Publisher";
//
// label17
//
this.label17.Location = new System.Drawing.Point(6, 92);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(71, 14);
this.label17.TabIndex = 24;
this.label17.Text = "Title";
//
// button3
//
this.button3.Enabled = false;
this.button3.Location = new System.Drawing.Point(325, 159);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(65, 24);
this.button3.TabIndex = 23;
this.button3.Text = "Read";
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// label11
//
this.label11.Location = new System.Drawing.Point(6, 68);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(71, 13);
this.label11.TabIndex = 7;
this.label11.Text = "ISBN";
//
// label12
//
this.label12.Location = new System.Drawing.Point(6, 43);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(71, 14);
this.label12.TabIndex = 6;
this.label12.Text = "Authur";
//
// label13
//
this.label13.Location = new System.Drawing.Point(6, 19);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(71, 14);
this.label13.TabIndex = 5;
this.label13.Text = "Name";
this.label13.Click += new System.EventHandler(this.label13_Click);
//
// label14
//
this.label14.Location = new System.Drawing.Point(10, 0);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(67, 16);
this.label14.TabIndex = 4;
this.label14.Text = "Read Block";
//
// groupBox10
//
this.groupBox10.Controls.Add(this.label18);
this.groupBox10.Controls.Add(this.label19);
this.groupBox10.Controls.Add(this.label20);
this.groupBox10.Controls.Add(this.label21);
this.groupBox10.Controls.Add(this.label22);
this.groupBox10.Controls.Add(this.label23);
this.groupBox10.Controls.Add(this.WBY);
this.groupBox10.Controls.Add(this.WBP);
this.groupBox10.Controls.Add(this.WBT);
this.groupBox10.Controls.Add(this.button4);
this.groupBox10.Controls.Add(this.WBI);
this.groupBox10.Controls.Add(this.WBA);
this.groupBox10.Controls.Add(this.WBN);
this.groupBox10.Controls.Add(this.label24);
this.groupBox10.Enabled = false;
this.groupBox10.Location = new System.Drawing.Point(24, 444);
this.groupBox10.Name = "groupBox10";
this.groupBox10.Size = new System.Drawing.Size(412, 190);
this.groupBox10.TabIndex = 20;
this.groupBox10.TabStop = false;
//
// label18
//
this.label18.Location = new System.Drawing.Point(4, 135);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(71, 32);
this.label18.TabIndex = 35;
this.label18.Text = "Published Year";
//
// label19
//
this.label19.Location = new System.Drawing.Point(6, 111);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(71, 14);
this.label19.TabIndex = 34;
this.label19.Text = "Publisher";
//
// label20
//
this.label20.Location = new System.Drawing.Point(6, 89);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(71, 14);
this.label20.TabIndex = 33;
this.label20.Text = "Title";
//
// label21
//
this.label21.Location = new System.Drawing.Point(6, 65);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(71, 14);
this.label21.TabIndex = 32;
this.label21.Text = "ISBN";
//
// label22
//
this.label22.Location = new System.Drawing.Point(6, 41);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(71, 14);
this.label22.TabIndex = 31;
this.label22.Text = "Authur";
//
// label23
//
this.label23.Location = new System.Drawing.Point(6, 16);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(71, 14);
this.label23.TabIndex = 30;
this.label23.Text = "Name";
//
// WBY
//
this.WBY.Location = new System.Drawing.Point(83, 135);
this.WBY.MaxLength = 5;
this.WBY.Name = "WBY";
this.WBY.Size = new System.Drawing.Size(307, 20);
this.WBY.TabIndex = 29;
this.WBY.Text = "";
//
// WBP
//
this.WBP.Location = new System.Drawing.Point(83, 111);
this.WBP.MaxLength = 20;
this.WBP.Name = "WBP";
this.WBP.Size = new System.Drawing.Size(307, 20);
this.WBP.TabIndex = 28;
this.WBP.Text = "";
this.WBP.TextChanged += new System.EventHandler(this.WRP_TextChanged);
//
// WBT
//
this.WBT.Location = new System.Drawing.Point(83, 87);
this.WBT.MaxLength = 50;
this.WBT.Name = "WBT";
this.WBT.Size = new System.Drawing.Size(307, 20);
this.WBT.TabIndex = 27;
this.WBT.Text = "";
//
// button4
//
this.button4.Enabled = false;
this.button4.Location = new System.Drawing.Point(325, 159);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(65, 24);
this.button4.TabIndex = 23;
this.button4.Text = "Write";
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// WBI
//
this.WBI.Location = new System.Drawing.Point(83, 62);
this.WBI.MaxLength = 15;
this.WBI.Name = "WBI";
this.WBI.Size = new System.Drawing.Size(307, 20);
this.WBI.TabIndex = 22;
this.WBI.Text = "";
//
// WBA
//
this.WBA.Location = new System.Drawing.Point(83, 38);
this.WBA.MaxLength = 20;
this.WBA.Name = "WBA";
this.WBA.Size = new System.Drawing.Size(307, 20);
this.WBA.TabIndex = 21;
this.WBA.Text = "";
//
// WBN
//
this.WBN.Location = new System.Drawing.Point(83, 14);
this.WBN.MaxLength = 30;
this.WBN.Name = "WBN";
this.WBN.Size = new System.Drawing.Size(307, 20);
this.WBN.TabIndex = 12;
this.WBN.Text = "";
//
// label24
//
this.label24.Location = new System.Drawing.Point(10, 0);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(67, 16);
this.label24.TabIndex = 4;
this.label24.Text = "Write Block";
//
// label25
//
this.label25.AutoSize = true;
this.label25.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label25.Location = new System.Drawing.Point(361, 645);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(70, 16);
this.label25.TabIndex = 21;
this.label25.Text = "Date: 3Nov08";
//
// label26
//
this.label26.AutoSize = true;
this.label26.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label26.Location = new System.Drawing.Point(305, 663);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(122, 16);
this.label26.TabIndex = 22;
this.label26.Text = "Tsang Wai Ho 51021529";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(458, 684);
this.Controls.Add(this.label26);
this.Controls.Add(this.label25);
this.Controls.Add(this.groupBox10);
this.Controls.Add(this.groupBox9);
this.Controls.Add(this.groupBox8);
this.Controls.Add(this.groupBox7);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.groupBox3);
this.Name = "Form1";
this.Text = "SmartCard";
this.Load += new System.EventHandler(this.Form1_Load);
this.groupBox3.ResumeLayout(false);
this.groupBox7.ResumeLayout(false);
this.groupBox8.ResumeLayout(false);
this.groupBox9.ResumeLayout(false);
this.groupBox10.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
CardReaderWrapper.OpenReader();
}
private void check_button_Click(object sender, System.EventArgs e)
{
if(CardReaderWrapper.CheckCard())
{
txtCardID.Text = CardReaderWrapper.GetCardID();
this.groupBox7.Enabled = true;
this.groupBox8.Enabled = true;
this.groupBox9.Enabled = true;
this.groupBox10.Enabled = true;
button1.Enabled = true;
button2.Enabled = true;
button3.Enabled = true;
button4.Enabled = true;
}
else
{
MessageBox.Show("No Card!!", "Message");
this.groupBox7.Enabled = false;
this.groupBox8.Enabled = false;
this.groupBox9.Enabled = false;
this.groupBox10.Enabled = false;
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
}
}
private void label1_Click(object sender, System.EventArgs e)
{
}
private void groupBox3_Enter(object sender, System.EventArgs e)
{
}
private void txtCardID_TextChanged(object sender, System.EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
}
private void lblCardID_Click(object sender, EventArgs e)
{
}
private void label1_Click_1(object sender, EventArgs e)
{
}
private void label3_Click(object sender, EventArgs e)
{
}
private void label8_Click(object sender, EventArgs e)
{
}
private void label13_Click(object sender, EventArgs e)
{
}
private void label7_Click(object sender, EventArgs e)
{
}
private void button1_Click_1(object sender, EventArgs e)
{
int Sector = 0;
int Block = 0;
//int condition;
if (RdS.Text == "0")
{
Sector = 0;
}
else if (RdS.Text == "1")
{
Sector = 1;
}
else if (RdS.Text == "2")
{
Sector = 2;
}
else if (RdS.Text == "3")
{
Sector = 3;
}
else if (RdS.Text == "4")
{
Sector = 4;
}
else if (RdS.Text == "5")
{
Sector = 5;
}
else if (RdS.Text == "6")
{
Sector = 6;
}
else if (RdS.Text == "7")
{
Sector = 7;
}
else if (RdS.Text == "8")
{
Sector = 8;
}
else if (RdS.Text == "9")
{
Sector = 9;
}
else if (RdS.Text == "10")
{
Sector = 10;
}
else if (RdS.Text == "11")
{
Sector = 11;
}
else if (RdS.Text == "12")
{
Sector = 12;
}
else if (RdS.Text == "13")
{
Sector = 13;
}
else if (RdS.Text == "14")
{
Sector = 14;
}
else if (RdS.Text == "15")
{
Sector = 15;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -