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 ++++++++++++++++++--------------
SDA/iWareSda/SdaMainForm.cs | 9 ++++++---
2 files changed, 24 insertions(+), 17 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
diff --git a/SDA/iWareSda/SdaMainForm.cs b/SDA/iWareSda/SdaMainForm.cs
index efdfe98..bfd8314 100644
--- a/SDA/iWareSda/SdaMainForm.cs
+++ b/SDA/iWareSda/SdaMainForm.cs
@@ -12,7 +12,7 @@
using System.Linq;
using iWareCommon;
using Newtonsoft.Json.Linq;
-
+using System.Threading.Tasks;
namespace iWareSda
{
@@ -108,8 +108,11 @@
{
#region 瀵瑰鍙戝竷WCF褰㈠紡鏁版嵁璁块棶鏈嶅姟
- var StationServiceHost = new ServiceHost(typeof(iWareSda.StationService));
- StationServiceHost.Open();
+ Task.Run(() =>
+ {
+ var StationServiceHost = new ServiceHost(typeof(iWareSda.StationService));
+ StationServiceHost.Open();
+ });
#endregion
--
Gitblit v1.9.3