private void timer1_Tick(object sender, EventArgs e) { if (this.ReadCard != null) { ReadCardEventArgs e1 = new ReadCardEventArgs(); Cursor old_cursor = this.Cursor; this.Cursor = Cursors.WaitCursor; this.ReadCard(this, e1); this.Cursor = old_cursor; if (e1.Done == true) { this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } } }
void dlg_ReadCard(object sender, ReadCardEventArgs e) { try { string strError = ""; string strTempXml = ""; // 2013/10/17 // prameters: // strStyle 如何获取数据。all/xml/photo 的一个或者多个的组合 // return: // -1 出错 // 0 成功 // 1 重复读入未拿走的卡号 int nRet = m_idcardObj.ReadCard("all", out strTempXml, out m_baPhoto, out strError); if (nRet != -1) { e.Done = true; Debug.Assert(string.IsNullOrEmpty(strTempXml) == false, ""); m_strIdcardXml = strTempXml; } } catch (Exception /*ex*/) { } }