private void PSThread(object obj) { try { ThreadParam p = obj as ThreadParam; string toPath = p.toPath; string xlPath = p.xlPath; string xlNpcPath = p.xlNpcPath; int sdIndex = p.sdIndex; f = new Func(); f.SetDMPath(PicPath); Thread.Sleep(500); int pid = 0, handle = 0; if (this.txtPID.Text.Trim() != "") { pid = int.Parse(txtPID.Text.Trim()); } if (this.txtHandle.Text.Trim() != "") { handle = int.Parse(txtHandle.Text.Trim()); } f.BindDM(ClassName, pid, handle); for (int i = 0; i < 9; i++) { f.DoBusiness(txtDtStr.Text.Trim(), toPath,xlPath,xlNpcPath,sdIndex); } f.UnBindDM(); this.Invoke(DelegateSetControl, new object[] { gbSetting, false }); this.Invoke(DelegateSetControl, new object[] { gbStart, false }); return; } catch (Exception ex) { this.Invoke(delegateShowMsg, new object[] { ex.Message }); } }