|
@ -6,6 +6,7 @@ using BBWY.Common.Models; |
|
|
using Microsoft.Extensions.Configuration; |
|
|
using Microsoft.Extensions.Configuration; |
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
using System; |
|
|
using System; |
|
|
|
|
|
using System.Diagnostics; |
|
|
using System.IO; |
|
|
using System.IO; |
|
|
using System.IO.MemoryMappedFiles; |
|
|
using System.IO.MemoryMappedFiles; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
@ -107,6 +108,28 @@ namespace BBWY.Client |
|
|
|
|
|
|
|
|
serviceCollection.AddTransient<_1688PreviewPurchaseViewModel>(); |
|
|
serviceCollection.AddTransient<_1688PreviewPurchaseViewModel>(); |
|
|
ServiceProvider = serviceCollection.BuildServiceProvider(); |
|
|
ServiceProvider = serviceCollection.BuildServiceProvider(); |
|
|
|
|
|
|
|
|
|
|
|
#region 启动本机WebSocket服务
|
|
|
|
|
|
{ |
|
|
|
|
|
var wssExeList = Process.GetProcessesByName("BBWY.WebSocket.Server"); |
|
|
|
|
|
if (wssExeList == null || wssExeList.Count() == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
ProcessStartInfo p = new ProcessStartInfo(); |
|
|
|
|
|
p.CreateNoWindow = true; |
|
|
|
|
|
p.FileName = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "BBWY.WebSocket.Server.exe"); |
|
|
|
|
|
p.Verb = "runas"; |
|
|
|
|
|
Process.Start(p); |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
MessageBox.Show(ex.Message, "启动bbwy websocket服务"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
base.OnStartup(e); |
|
|
base.OnStartup(e); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|