private void button_readCard_Click(object sender, EventArgs e) { try { IDCardInfo info = IDCardReader.getInstance().CardInfo; textBox_name.Text = info.name; textBox_idNumber.Text = info.idNumber; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button_readCard_Click(object sender, EventArgs e) { try { IDCardInfo info = IDCardReader.getInstance().CardInfo; textBox_name.Text = info.name; comboBox_idType.Text = "居民身份证"; textBox_idNumber.Text = info.idNumber; switch (info.sex) { case "男": comboBox_gender.Text = "男性"; break; case "女": comboBox_gender.Text = "女性"; break; default: comboBox_gender.Text = "未说明性别"; break; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }