private void btnGetStatus_Click(object sender, EventArgs e) { try { int r = IDCardAPI.SDT_GetSAMStatus(iPort, 1); txtStatus.Text = r.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }