2025年6月12日/AuxAllWCS/Build/Project/AuxAllWCS.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
2025年6月12日/AuxAllWCS/Build/Project/代码/VS自定义类/AutoThread.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
2025年6月12日/AuxAllWCS/Build/Project/界面/View1.xaml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
2025年6月12日/AuxAllWCS/Build/Project/界面/View1.xaml.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Build/Project/AuxAllWCS.csproj
@@ -34,6 +34,7 @@ <StartupObject /> </PropertyGroup> <ItemGroup> <Reference Include="Microsoft.Web.WebView2.Core, Version=1.0.3351.48, Culture=neutral, PublicKeyToken=2a8ab48044d2601e" /> <Reference Include="Microsoft.Web.WebView2.Wpf, Version=1.0.3351.48, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL"> <HintPath>packages\Microsoft.Web.WebView2.1.0.3351.48\lib\net462\Microsoft.Web.WebView2.Wpf.dll</HintPath> </Reference> 2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Build/Project/´úÂë/VS×Ô¶¨ÒåÀà/AutoThread.cs
@@ -2027,24 +2027,23 @@ } public class HttpServer { System.Net.HttpListener HttpSvcHost = null; private readonly string _listenerPrefix = ""; public static string _listenerPrefix = ""; public HttpServer(string ip) { _listenerPrefix = ip; _listenerPrefix = $"http://{ip}:8808/"; } public void HttpServerRun() { HttpSvcHost = new System.Net.HttpListener(); HttpSvcHost.AuthenticationSchemes = System.Net.AuthenticationSchemes.Anonymous; HttpSvcHost.Prefixes.Add($"http://{_listenerPrefix}:8808/"); HttpSvcHost.Prefixes.Add(_listenerPrefix); HttpSvcHost.Start(); HttpSvcHost.BeginGetContext(HttpSvcListenerCallback, null); } @@ -2327,8 +2326,6 @@ } } internal class WebSocketClient { 2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Build/Project/½çÃæ/View1.xaml
@@ -68,7 +68,7 @@ <TextBlock Text="WebView" Foreground="Purple" /> </StackPanel> </TabItem.Header> <wv2:WebView2 x:Name="webView" Source="https://developer.microsoft.com/zh-cn/"/> <wv2:WebView2 x:Name="webView" /> </TabItem> <!--<TabItem> <TabItem.Header> 2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Build/Project/½çÃæ/View1.xaml.cs
@@ -28,6 +28,8 @@ using GZ.DB.Repository.OIDATABASE; using GZ.DB.IRepository.OIDATABASE; using GZ.DB.Entity.OIDATABASE; using Microsoft.Web.WebView2.Wpf; using System.Threading; namespace GZ.Projects.AuxAllWCS { @@ -39,18 +41,36 @@ public View1() { InitializeComponent(); #region éå¶è¿è¡å®ä¾æ°é #region éå¶è¿è¡å®ä¾æ°é System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("AuxAllWCS"); if (processes.Length > System.Int32.Parse(System.Configuration.ConfigurationManager.AppSettings["InstanceLimit"])) { System.Windows.MessageBox.Show("è¿è¡å¤±è´¥:è¿è¡å®ä¾æ°éå·²è¶ åºéå¶"); this.Close(); } #endregion this.DataContext = ViewModel.CreateInstance(this,typeof(View1)); #endregion this.DataContext = ViewModel.CreateInstance(this, typeof(View1)); this.Loaded += (this.DataContext as ViewModel).View1_LoadEvent; this.Closing += (this.DataContext as ViewModel).View1_CloseEvent; this.Closing += (this.DataContext as ViewModel).View1_CloseEvent; commmd(); } public async void commmd() { await webView.EnsureCoreWebView2Async(); labbb: if (!string.IsNullOrEmpty(HttpServer._listenerPrefix)) if (webView.Source != new Uri(HttpServer._listenerPrefix)) { webView.CoreWebView2.Navigate(HttpServer._listenerPrefix + "/index.html"); goto EndInit; } System.Threading.Thread.Sleep(2000); goto labbb; EndInit: Console.WriteLine("end"); } } }