From 1cf00bcc4e6869b356dd15310648bb93c9b1bbde Mon Sep 17 00:00:00 2001
From: czw <selecti@yeah.net>
Date: 星期三, 23 七月 2025 09:10:15 +0800
Subject: [PATCH] init_内存泄漏测试- 增加全部释放

---
 2025年6月12日/AuxAllWCS/Build/Project/界面/View1.xaml.cs |   45 +++++++++++++++++++++++++++++----------------
 1 files changed, 29 insertions(+), 16 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 3ce9c97..3940a94 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"
@@ -28,8 +28,6 @@
 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
 {
@@ -52,24 +50,39 @@
             this.DataContext = ViewModel.CreateInstance(this, typeof(View1));
             this.Loaded += (this.DataContext as ViewModel).View1_LoadEvent;
             this.Closing += (this.DataContext as ViewModel).View1_CloseEvent;
-
-            commmd();
+            //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");
+        //    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 Set Uri");
+        //    webView.PreviewKeyDown += (object sender, KeyEventArgs e) =>
+        //    {
+        //        // 妫�煡鎸変笅鐨勯敭鏄惁鏄�F12锛屽鏋滄槸锛岀姝㈠叾榛樿琛屼负
+        //        if (e.Key == Key.F12)
+        //        {
+        //            e.Handled = true;
+        //        }
+        //    };
+        //    await webView.CoreWebView2.ExecuteScriptAsync(
+        //        @"
+        //            document.addEventListener('contextmenu', function(event) {
+        //                event.preventDefault();
+        //            }, false);
+        //        "
+        //    );
         }
     }
 }

--
Gitblit v1.9.1