From 30443483e37c7d323dca9c20d8407c3614acf542 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周三, 25 12月 2024 11:53:26 +0800 Subject: [PATCH] 22 --- CC/iWareCC_ASRS/FormCC.cs | 32 ++++++++++++++++++-------------- 1 files changed, 18 insertions(+), 14 deletions(-) diff --git a/CC/iWareCC_ASRS/FormCC.cs b/CC/iWareCC_ASRS/FormCC.cs index 133ea01..8199439 100644 --- a/CC/iWareCC_ASRS/FormCC.cs +++ b/CC/iWareCC_ASRS/FormCC.cs @@ -28,6 +28,7 @@ using System.Net; using System.ServiceModel; using System.Threading; +using System.Threading.Tasks; using System.Windows.Forms; using XiGang.Core.Model; using XiGang.Core.Model.ViewModels; @@ -279,22 +280,25 @@ #region 瀵瑰鍙戝竷WCF褰㈠紡鏁版嵁璁块棶鏈嶅姟 - try + Task.Run(() => { - #region 瀵瑰鍙戝竷WCF褰㈠紡鏁版嵁璁块棶鏈嶅姟 - var lineServiceHost = new ServiceHost(typeof(CCWcfService)); - lineServiceHost.Open(); - lbl_WCFMsg.Text = "鍙戝竷WCF鎴愬姛," + lineServiceHost.BaseAddresses[0].AbsoluteUri; - lbl_WCFMsg.ForeColor = Color.Green; - #endregion + try + { + #region 瀵瑰鍙戝竷WCF褰㈠紡鏁版嵁璁块棶鏈嶅姟 + var lineServiceHost = new ServiceHost(typeof(CCWcfService)); + lineServiceHost.Open(); + lbl_WCFMsg.Text = "鍙戝竷WCF鎴愬姛," + lineServiceHost.BaseAddresses[0].AbsoluteUri; + lbl_WCFMsg.ForeColor = Color.Green; + #endregion - } - catch (Exception ex) - { - Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.CCWCFService, "鍙戝竷WCF澶辫触", ex); - lbl_WCFMsg.Text = "鍙戝竷WCF澶辫触锛�" + ex.Message; - lbl_WCFMsg.ForeColor = Color.Red; - } + } + catch (Exception ex) + { + Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.CCWCFService, "鍙戝竷WCF澶辫触", ex); + lbl_WCFMsg.Text = "鍙戝竷WCF澶辫触锛�" + ex.Message; + lbl_WCFMsg.ForeColor = Color.Red; + } + }); #endregion -- Gitblit v1.9.3