WPF 多窗口分文件實現方案

WPF 多窗口分文件實現方案

項目文件結構

WindowSwitcher/
├── App.xaml
├── App.xaml.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Views/
│   ├── SettingsWindow.xaml
│   ├── SettingsWindow.xaml.cs
│   ├── DataWindow.xaml
│   ├── DataWindow.xaml.cs
│   ├── HelpWindow.xaml
│   └── HelpWindow.xaml.cs
└── Services/└── WindowManager.cs

1. 主窗口 (MainWindow.xaml)

<Window x:Class="WindowSwitcher.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local="clr-namespace:WindowSwitcher"Title="窗口切換管理器" Height="450" Width="800"><Grid><Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="*"/></Grid.RowDefinitions><!-- 導航按鈕區域 --><StackPanel Grid.Row="0" Orientation="Horizontal" Background="#f0f0f0" Padding="10"><Button Content="主窗口" Margin="5" Padding="10,5" Click="ShowMainWindow"/><Button Content="設置窗口" Margin="5" Padding="10,5" Click="ShowSettingsWindow"/><Button Content="數據窗口" Margin="5" Padding="10,5" Click="ShowDataWindow"/><Button Content="幫助窗口" Margin="5" Padding="10,5" Click="ShowHelpWindow"/><Button Content="退出應用" Margin="5" Padding="10,5" Click="ExitApplication" Background="#ffcccc" Foreground="DarkRed"/></StackPanel><!-- 主窗口內容 --><StackPanel Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"><TextBlock Text="歡迎使用窗口切換管理器" FontSize="24" Margin="0,0,0,20"/><TextBlock Text="{Binding CurrentStatus}" FontSize="18" Foreground="#666"/><Button Content="刷新窗口狀態" Margin="0,20,0,0" Padding="10,5" Click="RefreshStatus"/></StackPanel></Grid>
</Window>

2. 主窗口代碼 (MainWindow.xaml.cs)

using WindowSwitcher.Services;
using System.Windows;namespace WindowSwitcher
{public partial class MainWindow : Window{private readonly WindowManager _windowManager = WindowManager.Instance;public string CurrentStatus => $"當前活動窗口: {_windowManager.ActiveWindow?.Title}";public MainWindow(){InitializeComponent();DataContext = this;// 初始化所有窗口_windowManager.InitializeWindows();// 顯示主窗口_windowManager.ShowWindow<MainWindow>();}// 按鈕事件處理private void ShowMainWindow(object sender, RoutedEventArgs e) => _windowManager.ShowWindow<MainWindow>();private void ShowSettingsWindow(object sender, RoutedEventArgs e) => _windowManager.ShowWindow<SettingsWindow>();private void ShowDataWindow(object sender, RoutedEventArgs e) => _windowManager.ShowWindow<DataWindow>();private void ShowHelpWindow(object sender, RoutedEventArgs e) => _windowManager.ShowWindow<HelpWindow>();private void ExitApplication(object sender, RoutedEventArgs e) => Application.Current.Shutdown();private void RefreshStatus(object sender, RoutedEventArgs e){// 刷新數據綁定OnPropertyChanged(nameof(CurrentStatus));}// 實現簡單的屬性變更通知public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;protected virtual void OnPropertyChanged(string propertyName){PropertyChanged?.Invoke(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));}}
}

3. 設置窗口 (Views/SettingsWindow.xaml)

<Window x:Class="WindowSwitcher.Views.SettingsWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="系統設置" Height="400" Width="600"><Grid Margin="20"><Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="*"/></Grid.RowDefinitions><TextBlock Grid.Row="0" Text="系統設置" FontSize="20" FontWeight="Bold" Margin="0,0,0,20"/><StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,10"><TextBlock Text="主題:" Width="100" VerticalAlignment="Center"/><ComboBox Width="200"><ComboBoxItem Content="淺色主題"/><ComboBoxItem Content="深色主題" IsSelected="True"/></ComboBox></StackPanel><StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0,0,0,10"><TextBlock Text="語言:" Width="100" VerticalAlignment="Center"/><ComboBox Width="200"><ComboBoxItem Content="中文"/><ComboBoxItem Content="English"/></ComboBox></StackPanel><StackPanel Grid.Row="3" Orientation="Horizontal" Margin="0,0,0,20"><TextBlock Text="自動保存:" Width="100" VerticalAlignment="Center"/><CheckBox IsChecked="True" VerticalAlignment="Center"/></StackPanel><Button Grid.Row="4" Content="返回主窗口" HorizontalAlignment="Center" Padding="10,5" Click="ReturnToMain" VerticalAlignment="Bottom"/></Grid>
</Window>

4. 設置窗口代碼 (Views/SettingsWindow.xaml.cs)

using System.Windows;
using WindowSwitcher.Services;namespace WindowSwitcher.Views
{public partial class SettingsWindow : Window{private readonly WindowManager _windowManager = WindowManager.Instance;public SettingsWindow(){InitializeComponent();}private void ReturnToMain(object sender, RoutedEventArgs e){_windowManager.ShowWindow<MainWindow>();}}
}

5. 數據窗口 (Views/DataWindow.xaml)

<Window x:Class="WindowSwitcher.Views.DataWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="數據分析" Height="500" Width="700"><Grid Margin="15"><Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="*"/><RowDefinition Height="Auto"/></Grid.RowDefinitions><TextBlock Grid.Row="0" Text="數據分析面板" FontSize="20" FontWeight="Bold" Margin="0,0,0,15"/><!-- 數據表格 --><DataGrid Grid.Row="1" AutoGenerateColumns="True" ItemsSource="{Binding DataItems}"><DataGrid.Columns><DataGridTextColumn Header="ID" Binding="{Binding Id}" Width="Auto"/><DataGridTextColumn Header="名稱" Binding="{Binding Name}" Width="*"/><DataGridTextColumn Header="數值" Binding="{Binding Value}" Width="Auto"/><DataGridTextColumn Header="日期" Binding="{Binding Date, StringFormat=yyyy-MM-dd}" Width="Auto"/></DataGrid.Columns></DataGrid><StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,15,0,0"><Button Content="加載數據" Padding="10,5" Margin="0,0,10,0" Click="LoadData"/><Button Content="返回主窗口" Padding="10,5" Click="ReturnToMain"/></StackPanel></Grid>
</Window>

6. 數據窗口代碼 (Views/DataWindow.xaml.cs)

using System.Windows;
using System.Collections.ObjectModel;
using WindowSwitcher.Services;namespace WindowSwitcher.Views
{public partial class DataWindow : Window{private readonly WindowManager _windowManager = WindowManager.Instance;// 數據模型public class DataItem{public int Id { get; set; }public string Name { get; set; }public double Value { get; set; }public DateTime Date { get; set; }}// 數據集合public ObservableCollection<DataItem> DataItems { get; } = new ObservableCollection<DataItem>();public DataWindow(){InitializeComponent();DataContext = this;// 初始加載一些示例數據LoadSampleData();}private void LoadSampleData(){DataItems.Clear();// 添加示例數據DataItems.Add(new DataItem { Id = 1, Name = "項目A", Value = 42.5, Date = DateTime.Now.AddDays(-2) });DataItems.Add(new DataItem { Id = 2, Name = "項目B", Value = 78.3, Date = DateTime.Now.AddDays(-1) });DataItems.Add(new DataItem { Id = 3, Name = "項目C", Value = 15.2, Date = DateTime.Now });}private void LoadData(object sender, RoutedEventArgs e){// 模擬加載更多數據int startId = DataItems.Count + 1;for (int i = 0; i < 5; i++){DataItems.Add(new DataItem {Id = startId + i,Name = $"新增項目{startId + i}",Value = new Random().NextDouble() * 100,Date = DateTime.Now.AddDays(-i)});}}private void ReturnToMain(object sender, RoutedEventArgs e){_windowManager.ShowWindow<MainWindow>();}}
}

7. 幫助窗口 (Views/HelpWindow.xaml)

<Window x:Class="WindowSwitcher.Views.HelpWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="幫助文檔" Height="350" Width="500"><Grid Margin="15"><Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="*"/><RowDefinition Height="Auto"/></Grid.RowDefinitions><TextBlock Grid.Row="0" Text="幫助與支持" FontSize="20" FontWeight="Bold" Margin="0,0,0,10"/><ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto"><TextBlock TextWrapping="Wrap"><Run FontWeight="Bold">如何使用窗口切換功能:</Run><LineBreak/>1. 點擊頂部導航欄中的按鈕可在不同窗口間切換<LineBreak/>2. 每個窗口都提供"返回主窗口"按鈕<LineBreak/>3. 窗口狀態會被保留,再次打開時保持上次的狀態<LineBreak/><LineBreak/><Run FontWeight="Bold">常見問題:</Run><LineBreak/>Q: 為什么關閉按鈕只是隱藏窗口?<LineBreak/>A: 這是設計選擇,為了保持窗口狀態并快速切換。要完全退出應用,請使用"退出應用"按鈕。<LineBreak/><LineBreak/><Run FontWeight="Bold">技術支持:</Run><LineBreak/>如有任何問題,請聯系 support@windowswitcher.com</TextBlock></ScrollViewer><Button Grid.Row="2" Content="返回主窗口" Padding="10,5" HorizontalAlignment="Center" Margin="0,15,0,0" Click="ReturnToMain"/></Grid>
</Window>

8. 幫助窗口代碼 (Views/HelpWindow.xaml.cs)

using System.Windows;
using WindowSwitcher.Services;namespace WindowSwitcher.Views
{public partial class HelpWindow : Window{private readonly WindowManager _windowManager = WindowManager.Instance;public HelpWindow(){InitializeComponent();}private void ReturnToMain(object sender, RoutedEventArgs e){_windowManager.ShowWindow<MainWindow>();}}
}

9. 窗口管理器 (Services/WindowManager.cs)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using WindowSwitcher.Views;namespace WindowSwitcher.Services
{public sealed class WindowManager{// 單例實例private static readonly Lazy<WindowManager> _instance = new Lazy<WindowManager>(() => new WindowManager());public static WindowManager Instance => _instance.Value;// 存儲所有窗口實例private readonly Dictionary<Type, Window> _windows = new Dictionary<Type, Window>();// 當前活動窗口public Window ActiveWindow { get; private set; }private WindowManager() { }// 初始化所有窗口public void InitializeWindows(){// 創建主窗口CreateWindow<MainWindow>();// 創建其他窗口CreateWindow<SettingsWindow>();CreateWindow<DataWindow>();CreateWindow<HelpWindow>();}// 創建窗口實例private void CreateWindow<T>() where T : Window, new(){var windowType = typeof(T);if (!_windows.ContainsKey(windowType)){var window = new T();window.Closing += OnWindowClosing;_windows[windowType] = window;}}// 顯示指定類型的窗口public void ShowWindow<T>() where T : Window{var windowType = typeof(T);if (_windows.TryGetValue(windowType, out Window window)){// 隱藏當前活動窗口if (ActiveWindow != null && ActiveWindow != window){ActiveWindow.Hide();}// 顯示新窗口window.Show();window.Activate();window.Focus();ActiveWindow = window;}else{// 如果窗口尚未創建,則創建并顯示CreateWindow<T>();ShowWindow<T>();}}// 窗口關閉事件處理private void OnWindowClosing(object sender, CancelEventArgs e){if (sender is Window window){// 阻止實際關閉,改為隱藏e.Cancel = true;window.Hide();// 如果關閉的是當前活動窗口,則激活主窗口if (ActiveWindow == window){ShowWindow<MainWindow>();}}}// 獲取特定類型的窗口public T GetWindow<T>() where T : Window{return _windows.TryGetValue(typeof(T), out Window window) ? (T)window : null;}// 關閉所有窗口并退出public void ShutdownApplication(){// 關閉所有窗口foreach (var window in _windows.Values){window.Closing -= OnWindowClosing;window.Close();}_windows.Clear();Application.Current.Shutdown();}}
}

10. 應用程序入口 (App.xaml)

<Application x:Class="WindowSwitcher.App"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"StartupUri="MainWindow.xaml"><Application.Resources><!-- 全局樣式可以放在這里 --></Application.Resources>
</Application>

11. 應用程序入口代碼 (App.xaml.cs)

using System.Windows;
using WindowSwitcher.Services;namespace WindowSwitcher
{public partial class App : Application{protected override void OnStartup(StartupEventArgs e){base.OnStartup(e);// 初始化窗口管理器var windowManager = WindowManager.Instance;windowManager.InitializeWindows();}protected override void OnExit(ExitEventArgs e){// 清理資源WindowManager.Instance.ShutdownApplication();base.OnExit(e);}}
}

關鍵實現說明

1. 分文件組織

  • MainWindow:主窗口,作為應用入口
  • Views文件夾:包含所有其他窗口(設置、數據、幫助)
  • Services文件夾:包含窗口管理器服務

2. 窗口管理器核心功能

// 創建窗口
private void CreateWindow<T>() where T : Window, new()
{var windowType = typeof(T);if (!_windows.ContainsKey(windowType)){var window = new T();window.Closing += OnWindowClosing;_windows[windowType] = window;}
}// 切換窗口
public void ShowWindow<T>() where T : Window
{// ...window.Show();window.Activate();window.Focus();ActiveWindow = window;
}// 處理關閉事件
private void OnWindowClosing(object sender, CancelEventArgs e)
{e.Cancel = true; // 阻止實際關閉window.Hide();   // 改為隱藏
}

3. 數據綁定示例

在數據窗口中,展示了如何使用數據綁定:

// 數據模型
public class DataItem
{public int Id { get; set; }public string Name { get; set; }public double Value { get; set; }public DateTime Date { get; set; }
}// 數據集合
public ObservableCollection<DataItem> DataItems { get; } = new ObservableCollection<DataItem>();// XAML綁定
<DataGrid ItemsSource="{Binding DataItems}">

4. 屬性變更通知

在主窗口中實現了簡單的屬性變更通知:

public string CurrentStatus => $"當前活動窗口: {_windowManager.ActiveWindow?.Title}";// 刷新方法
private void RefreshStatus(object sender, RoutedEventArgs e)
{OnPropertyChanged(nameof(CurrentStatus));
}// 實現INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

使用說明

  1. 項目結構

    • 創建一個新的WPF應用程序項目
    • 按上述文件結構組織代碼
  2. 啟動應用

    • 應用程序啟動時會初始化所有窗口
    • 主窗口首先顯示
  3. 窗口切換

    • 使用頂部導航欄按鈕在不同窗口間切換
    • 每個窗口都有返回主窗口的按鈕
  4. 關閉窗口

    • 點擊關閉按鈕實際上是隱藏窗口
    • 使用"退出應用"按鈕完全關閉程序
  5. 數據保持

    • 每個窗口的狀態在切換時保持不變
    • 數據窗口中的數據在重新打開時保持

這種分文件實現方式使代碼結構清晰,便于維護和擴展,同時保持了窗口切換的高性能和狀態保持特性。

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/pingmian/89522.shtml
繁體地址,請注明出處:http://hk.pswp.cn/pingmian/89522.shtml
英文地址,請注明出處:http://en.pswp.cn/pingmian/89522.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

在服務器(ECS)部署 MySQL 操作流程

在部署 MySQL 數據庫之前需要準備好服務器環境。可以通過以下兩種方式來準備部署服務器&#xff1a;云服務器&#xff08;ECS&#xff09;&#xff0c;如&#xff1a;阿里云、華為云、騰訊云等。IDC服務器。 現以阿里云服務器&#xff08;ECS&#xff09;Windows版本來進行部署…

Java File 類詳解:從基礎操作到實戰應用,掌握文件與目錄處理全貌

作為一名 Java 開發工程師&#xff0c;你一定在實際開發中遇到過需要操作文件或目錄的場景&#xff0c;例如&#xff1a;讀寫配置文件、上傳下載、日志處理、文件遍歷、路徑管理等。Java 提供了 java.io.File 類來幫助開發者完成這些任務。本文將帶你全面掌握&#xff1a;File …

嵌入式學習-PyTorch(9)-day25

進入尾聲&#xff0c;一個完整的模型訓練 &#xff0c;點亮的第一個led#自己注釋版 import torch import torchvision.datasets from torch import nn from torch.utils.tensorboard import SummaryWriter import time # from model import * from torch.utils.data import Dat…

用AI做帶貨視頻評論分析進階提分【Datawhale AI 夏令營】

文章目錄回顧賽題優化1??優化2??回顧賽題 模塊內容類型說明/示例賽題背景概述參賽者需構建端到端評論分析系統&#xff0c;實現商品識別、多維情感分析、評論聚類與主題提煉三大任務。商品識別輸入video_desc&#xff08;視頻描述&#xff09; video_tags&#xff08;標簽…

Redis常見數據結構詳細介紹

Redis 作為一款高性能的開源內存數據庫&#xff0c;憑借其豐富多樣的數據結構和出色的性能&#xff0c;在緩存、會話存儲、實時分析等眾多場景中得到了廣泛應用。下面將詳細介紹 Redis 主要的數據結構&#xff0c;包括它們的類型、具體用法和適用場景。1、字符串&#xff08;St…

HAMR硬盤高溫寫入的可靠性問題

熱輔助磁記錄(HAMR)作為突破傳統磁記錄密度極限的下一代存儲技術,其在數據中心大規模應用的核心挑戰在于可靠性保障。 擴展閱讀: 下一個存儲戰場:HAMR技術HDD HAMR技術進入云存儲市場! 漫談HAMR硬盤的可靠性 隨著存儲密度向4Tbpsi邁進,傳統磁記錄技術遭遇"三難困境…

使用llama-factory進行qwen3模型微調

運行環境 Linux 系統(ubuntu) Gpu (NVIDIA) 安裝部署 llama factory CUDA 安裝 首先,在 https://developer.nvidia.com/cuda-gpus 查看您的 GPU 是否支持CUDA 保證當前 Linux 版本支持CUDA. 在命令行中輸入 uname -m && cat /etc/*release,應當看到類似的輸出 x8…

tcp/udp調試工具

幾款tcp/udp調試工具 下載地址&#xff1a;夸克網盤

智慧光伏發電信息化系統需求文檔

以下是從產品經理角度撰寫的智慧光伏發電信息化系統需求文檔&#xff0c;聚焦光伏行業痛點與業務價值&#xff0c;遵循標準PRD結構&#xff1a;智慧光伏發電信息化系統需求文檔 版本&#xff1a;1.0 日期&#xff1a;2025年7月19日 作者&#xff1a;產品經理視角一、文檔概述 1…

ARCS系統機器視覺實戰(直播回放)

ARCS系統機器視覺實戰本次培訓主要圍繞ARCS操作系統中的視覺與機器人同步應用展開&#xff0c;詳細講解了網絡配置、視覺軟件設置、九點標定、機器人程序編寫以及數據通信等內容。以下是關鍵要點提煉&#xff1a; 網絡配置 為機器人、相機和電腦分別設置靜態IP地址&#xff0c;…

Http請求中的特殊字符

問題 一個 springboot 應用&#xff0c;包含如下 controller RestController public class DemoController {GetMapping("/get")public ResponseEntity<String> get(RequestParam(value "cid2") String cid2) 準備測試數據 String cid2 "…

告別手動報表開發!描述數據維度,AI 自動生成 SQL 查詢 + Java 導出接口

Java 開發中&#xff0c;報表模塊往往是 “隱形耗時大戶”—— 產品經理要 “按地區、月份統計訂單量”&#xff0c;開發者需先編寫 SQL 查詢&#xff0c;再手動開發導出接口&#xff0c;稍作調整又要重新調試&#xff0c;耗費大量時間在重復勞動上。飛算 JavaAI 通過 “數據維…

函數設計測試用例

//歸并排序:public static void mergeSort(int[] a,int left,int right){if(left > right)return;int mid left(right -left)/2;mergeSort(a,left,mid);mergeSort(a,mid1,right);int[] tmp new int[a.length];int l left,r mid1,k left;while(l<mid && r<…

Vmware虛擬機使用僅主機模式共享物理網卡訪問互聯網

一、概述 Vmware虛擬機網卡模式有三種&#xff1a;橋接模式、僅主機模式、NAT模式。默認情況下&#xff0c;Vmware虛擬機使用僅主機模式不能訪問互聯網。因此&#xff0c;虛擬機可以共享宿主機的物理網卡訪問互聯網。 三種網卡模式的區別二、Vmware網絡設置 2.1、調整虛擬網絡 …

聲畫同步!5 個音視頻素材適配的網站,創作更和諧

視頻畫面和背景音樂不搭&#xff1f;音效和動作不同步&#xff1f;好的作品&#xff0c;聲音和畫面必須像齒輪一樣咬合。這 5 個專注 “聲畫同步” 的素材網站&#xff0c;能讓音視頻素材精準匹配&#xff0c;從旋律到節奏&#xff0c;從音效到畫面&#xff0c;都默契十足&…

13.多種I/O函數

前言 之前的示例中&#xff0c;基于Linux的使用read&write函數完成數據I/O&#xff0c;基于Windows的則使用send&recv函數。這次的Linux示例也將使用send& recv函數&#xff0c;并講解其與read&write函數相比的優點。還將介紹幾種其他的I/O函數。 一、send &am…

設計模式五:橋模式(Bridge Pattern)

橋模式是一種結構型設計模式&#xff0c;它將抽象部分與其實現部分分離&#xff0c;使它們可以獨立變化。這種模式通過提供橋梁結構將抽象和實現解耦。橋模式的結構橋模式包含以下主要角色&#xff1a;Abstraction&#xff08;抽象類&#xff09;&#xff1a;定義抽象接口&…

深入理解設計模式之模板模式:優雅地定義算法骨架

在軟件開發中&#xff0c;我們經常會遇到這樣的情況&#xff1a;多個類執行相似的操作流程&#xff0c;但每個類在流程的某些步驟上有自己特定的實現。如果為每個類都完整地編寫整個流程&#xff0c;會導致大量重復代碼&#xff0c;且難以維護。這時候&#xff0c;模板模式&…

基于單片機寵物喂食器/智能寵物窩/智能飼養

傳送門 &#x1f449;&#x1f449;&#x1f449;&#x1f449;其他作品題目速選一覽表 &#x1f449;&#x1f449;&#x1f449;&#x1f449;其他作品題目功能速覽 概述 深夜加班時&#xff0c;你是否擔心家中寵物餓肚子&#xff1f;出差旅途中&#xff0c;是否焦慮寵…

靜態補丁腳本 - 修改 libtolua.so

直接改arm64的so&#xff0c; 使用python腳本。#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 靜態補丁腳本 - 修改 libtolua.so 主要功能&#xff1a; 1. 修改 luaL_loadbuffer 函數&#xff0c;將跳轉目標從 luaL_loadbufferx 改為 luaL_loadfilex 2. …