private void btnClose_Click(object sender, EventArgs e) { try { int i = IDCardAPI.SDT_ClosePort(iPort); if (i == 144) { this.txtClose.Text = "关闭设备成功"; } else { txtMFbyte.Text = "关闭设备失败"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { IDCardAPI.SDT_ClosePort(iPort); }