diff --git a/App.xaml.cs b/App.xaml.cs index 8861b7c..9b2d50d 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -22,7 +22,9 @@ namespace WpfApp /// 如果硬件已绑定且匹配返回true,否则返回false private static bool CheckHardwareBinding() { - string storedHardwareId = "8f07378cbfb5247c6481694a0ba0cb0b74739eddcc91f591623409a45803ee69"; + //string storedHardwareId = "8f07378cbfb5247c6481694a0ba0cb0b74739eddcc91f591623409a45803ee69"; + string storedHardwareId = "2703a031ecb416bd4ef9b91a5bd5f8698f745bb9efcbf7da35d251d0491b9cd8"; + return HardwareInfo.ValidateHardwareId(storedHardwareId); } /// @@ -59,6 +61,7 @@ namespace WpfApp if (!CheckHardwareBinding()) { MessageBox.Show("检测到硬件环境发生变化,应用程序无法启动!", "警告", MessageBoxButton.OK, MessageBoxImage.Warning); + Console.WriteLine($"硬件环境序列号:{HardwareInfo.GetHardwareId()}"); LogService.Log.Info($"硬件环境序列号:{HardwareInfo.GetHardwareId()}"); Shutdown(); // 退出应用程序 return; @@ -70,7 +73,7 @@ namespace WpfApp Shutdown(); // 退出应用程序 return; } - + try { // 获取主窗口实例并显示 diff --git a/MainWindow.xaml b/MainWindow.xaml index e1b0e8d..2f9a386 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -3,11 +3,373 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:local="clr-namespace:WpfApp" + xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" + xmlns:local="clr-namespace:WpfApp.src.components" + mc:Ignorable="d" - Title="MainWindow" Height="450" Width="800"> + Title="MainWindow" Height="800" Width="1200"> + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +