From cc6cdfa7145b94a7e0878f9db8bb295cce2e1d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=9C=B2=E5=B0=A7?= Date: Thu, 27 Oct 2022 09:28:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E7=BD=91=E7=BB=86=E8=8A=82=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E5=A2=9E=E5=8A=A0=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AccountConfig.xml | 6 +++ .../Getf.Service.Transfer.WinService.csproj | 22 +++++++++ .../Service1.cs | 45 ++++++++++--------- .../Getf.Service.Transfer/AccountConfig.xml | 6 +++ .../Getf.Service.Transfer.csproj | 4 +- 5 files changed, 61 insertions(+), 22 deletions(-) diff --git a/94_wai/Getf.Service.Transfer.WinService/AccountConfig.xml b/94_wai/Getf.Service.Transfer.WinService/AccountConfig.xml index dd55f2d..a4a486f 100644 --- a/94_wai/Getf.Service.Transfer.WinService/AccountConfig.xml +++ b/94_wai/Getf.Service.Transfer.WinService/AccountConfig.xml @@ -30,4 +30,10 @@ NxWKPixtbPX6fRbts2ht0NvWDyVgUbuDxTZiWbWdguU2OuIJhgmHB5Q75kmXkxtJ 6EBbbHHcGJpDKaNwjhrV4WHrftabpyDYILtlFW7SSZOwNxCnb0XEsifOqEpgdfjo + + Reg.Custom.SourceCode + ab2cb0aa78cb986d3d05059b8f9bafee + 86bf52124bc423351c9da81cb3dd8c94 + Reg.Custom.SourceCode + \ No newline at end of file diff --git a/94_wai/Getf.Service.Transfer.WinService/Getf.Service.Transfer.WinService.csproj b/94_wai/Getf.Service.Transfer.WinService/Getf.Service.Transfer.WinService.csproj index 703f304..1436d17 100644 --- a/94_wai/Getf.Service.Transfer.WinService/Getf.Service.Transfer.WinService.csproj +++ b/94_wai/Getf.Service.Transfer.WinService/Getf.Service.Transfer.WinService.csproj @@ -12,6 +12,21 @@ 512 true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true AnyCPU @@ -105,5 +120,12 @@ Getf.Service.Transfer.Core + + + False + .NET Framework 3.5 SP1 + false + + \ No newline at end of file diff --git a/94_wai/Getf.Service.Transfer.WinService/Service1.cs b/94_wai/Getf.Service.Transfer.WinService/Service1.cs index 76c76ee..b1c076e 100644 --- a/94_wai/Getf.Service.Transfer.WinService/Service1.cs +++ b/94_wai/Getf.Service.Transfer.WinService/Service1.cs @@ -12,17 +12,17 @@ using System.Threading.Tasks; namespace Getf.Service.Transfer.WinService { - public partial class Service1 : ServiceBase - { - private Server _Server; - public Service1() - { - InitializeComponent(); - } + public partial class Service1 : ServiceBase + { + private Server _Server; + public Service1() + { + InitializeComponent(); + } - protected override void OnStart(string[] args) - { - /*var ipInfo = System.Configuration.ConfigurationManager.AppSettings["IpInfo"].Split(':'); + protected override void OnStart(string[] args) + { + /*var ipInfo = System.Configuration.ConfigurationManager.AppSettings["IpInfo"].Split(':'); _Server = new Server(); if (ipInfo[0] != String.Empty) { @@ -34,16 +34,19 @@ namespace Getf.Service.Transfer.WinService } _Server.Start();*/ - var boostrap = BootstrapFactory.CreateBootstrap(); - boostrap.Initialize(); - boostrap.Start(); - } + var boostrap = BootstrapFactory.CreateBootstrap(); + boostrap.Initialize(); + boostrap.Start(); + } - protected override void OnStop() - { - _Server.Stop(); - _Server.Dispose(); - _Server = null; - } - } + protected override void OnStop() + { + if (_Server != null) + { + _Server.Stop(); + _Server.Dispose(); + _Server = null; + } + } + } } diff --git a/94_wai/Getf.Service.Transfer/AccountConfig.xml b/94_wai/Getf.Service.Transfer/AccountConfig.xml index 98f6f3e..b50b4c1 100644 --- a/94_wai/Getf.Service.Transfer/AccountConfig.xml +++ b/94_wai/Getf.Service.Transfer/AccountConfig.xml @@ -30,4 +30,10 @@ NxWKPixtbPX6fRbts2ht0NvWDyVgUbuDxTZiWbWdguU2OuIJhgmHB5Q75kmXkxtJ 6EBbbHHcGJpDKaNwjhrV4WHrftabpyDYILtlFW7SSZOwNxCnb0XEsifOqEpgdfjo + + Reg.Custom.SourceCode + ab2cb0aa78cb986d3d05059b8f9bafee + 86bf52124bc423351c9da81cb3dd8c94 + Reg.Custom.SourceCode + \ No newline at end of file diff --git a/94_wai/Getf.Service.Transfer/Getf.Service.Transfer.csproj b/94_wai/Getf.Service.Transfer/Getf.Service.Transfer.csproj index 3f676c7..568e715 100644 --- a/94_wai/Getf.Service.Transfer/Getf.Service.Transfer.csproj +++ b/94_wai/Getf.Service.Transfer/Getf.Service.Transfer.csproj @@ -81,7 +81,9 @@ - + + PreserveNewest + \ No newline at end of file