private void CFormCIMCWorker_Load(object sender, EventArgs e) { if (!CStaticClass.CheckPushService()) {// 检查服务 return; } QueryServiceClient proxy = new QueryServiceClient(); try { // 语音配置查询列表 List <CSoundDto> lstSoundDto = proxy.GetSoundList(); this.DgvSound.DataSource = new BindingList <CSoundDto>(lstSoundDto); // Led配置查询列表 List <CLedContentDto> lstLedContentDto = proxy.GetLEDContentList(); this.DgvLed.DataSource = new BindingList <CLedContentDto>(lstLedContentDto); // 报文队列查询列表 GetFindQueueLst(proxy); OnResize(null); } catch (TimeoutException) { MessageBox.Show("The service operation timed out. ", "超时", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (FaultException exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "SOAP错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (CommunicationException exception) { MessageBox.Show("There was a communication problem. " + CStaticClass.GetExceptionInfo(exception), "通信错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "应用程序异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } proxy.Close(); }