From 3764f7713933126fe68aebeac30a792606a3e1e1 Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期四, 03 七月 2025 17:18:24 +0800 Subject: [PATCH] 1 --- 2025年6月12日/AuxAllWCS/Build/Project/界面/View1.xaml.cs | 28 +++++++++++++++++++++++----- 1 files changed, 23 insertions(+), 5 deletions(-) diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\347\225\214\351\235\242/View1.xaml.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\347\225\214\351\235\242/View1.xaml.cs" index 0b220b8..565e36f 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\347\225\214\351\235\242/View1.xaml.cs" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\347\225\214\351\235\242/View1.xaml.cs" @@ -39,18 +39,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"); } } } - + -- Gitblit v1.9.1