private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e) { try { do { idinfo = CardCpu.readIdCard(); Thread.Sleep(1000); } while (idinfo == null); e.Result = idinfo; } catch { } }