private void button1_Click(object sender, EventArgs e) { if (card.Status == DeviceStatus.CLOSE) { card.Open(); } }
private void Form1_Load(object sender, EventArgs e) { card = new HgIcCard(); card.PortName = "COM14"; //card.CardChanged += new CardChangedEventHandler(OnCardChanged); card.Open(); card.InitCard(); tbID.Text = card.ID; }
/// <summary> /// 启动读卡器 /// </summary> private void startCarCardScan() { if (_hgIcCard != null) { _hgIcCard.CardChanged += new CardChangedEventHandler(_hgIcCard_CardChanged); if (_hgIcCard.Init(comboSerialNO.Text) && _hgIcCard.Open()) { ultraToolbarsManager1.Toolbars[0].Tools["ReadCard"].SharedProps.Caption = "关闭"; comboSerialNO.Enabled = false; } } }