2026-01-16 17:07:43 +08:00
|
|
|
|
<Window
|
|
|
|
|
|
x:Class="KeyGen.MainWindow"
|
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
|
xmlns:local="clr-namespace:KeyGen"
|
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
|
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
|
|
|
|
|
Title="授权算号器"
|
|
|
|
|
|
Width="800"
|
|
|
|
|
|
Height="450"
|
|
|
|
|
|
ui:Design.RequestedTheme="Light"
|
|
|
|
|
|
ui:TitleBar.Height="36"
|
|
|
|
|
|
ui:WindowHelper.SystemBackdropType="Mica"
|
|
|
|
|
|
ui:WindowHelper.UseModernWindowStyle="True"
|
|
|
|
|
|
mc:Ignorable="d">
|
|
|
|
|
|
<Window.Resources>
|
|
|
|
|
|
<ResourceDictionary>
|
|
|
|
|
|
<Style BasedOn="{StaticResource {x:Type TextBox}}" TargetType="TextBox">
|
|
|
|
|
|
<Setter Property="Margin" Value="5" />
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
<Style BasedOn="{StaticResource {x:Type Button}}" TargetType="Button">
|
|
|
|
|
|
<Setter Property="Margin" Value="5" />
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</ResourceDictionary>
|
|
|
|
|
|
</Window.Resources>
|
|
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
2026-02-23 11:21:51 +08:00
|
|
|
|
|
|
|
|
|
|
<TabControl ui:TabControlHelper.IsAddTabButtonVisible="False">
|
|
|
|
|
|
<TabItem
|
|
|
|
|
|
ui:TabItemHelper.IsClosable="False"
|
|
|
|
|
|
Header="长期授权算号器"
|
|
|
|
|
|
IsSelected="True">
|
|
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<GroupBox
|
|
|
|
|
|
Margin="5"
|
|
|
|
|
|
BorderThickness="0"
|
|
|
|
|
|
FontSize="16"
|
|
|
|
|
|
Foreground="DeepSkyBlue"
|
|
|
|
|
|
Header="公私密钥"
|
|
|
|
|
|
Style="{x:Null}">
|
|
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition />
|
|
|
|
|
|
<ColumnDefinition />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<TextBox
|
|
|
|
|
|
x:Name="PrivateKeyTextBox"
|
|
|
|
|
|
ui:ControlHelper.Header="RSA私钥:"
|
|
|
|
|
|
ui:ControlHelper.PlaceholderText="请输入RSA私钥,私钥需要保存在自己电脑,避免外泄"
|
|
|
|
|
|
TextWrapping="WrapWithOverflow"
|
|
|
|
|
|
ToolTip="私钥需要保存在自己电脑,避免外泄" />
|
|
|
|
|
|
<TextBox
|
|
|
|
|
|
x:Name="PublicKeyTextBox"
|
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
|
ui:ControlHelper.Header="RSA公钥:"
|
|
|
|
|
|
ui:ControlHelper.PlaceholderText="请输入RSA公钥,公钥用在需要验证密钥的客户端代码、蓝图里"
|
|
|
|
|
|
TextWrapping="WrapWithOverflow"
|
|
|
|
|
|
ToolTip="公钥用在需要验证密钥的客户端代码、蓝图里" />
|
|
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
Margin="5"
|
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
|
Click="ImportPrivateKeyClick">
|
|
|
|
|
|
<ui:IconAndText Content="导入文件私钥" Icon="{x:Static ui:SegoeFluentIcons.Import}" />
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<UniformGrid
|
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
|
Rows="1">
|
|
|
|
|
|
<Button Click="GenerateKeyClick">
|
|
|
|
|
|
<ui:IconAndText Content="计算公私密钥" Icon="{x:Static ui:SegoeFluentIcons.Calculator}" />
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button Click="SaveKeysClick">
|
|
|
|
|
|
<ui:IconAndText Content="保存公私密钥" Icon="{x:Static ui:SegoeFluentIcons.Save}" />
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</UniformGrid>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</GroupBox>
|
|
|
|
|
|
<Rectangle
|
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
Height="1"
|
2026-01-16 17:07:43 +08:00
|
|
|
|
HorizontalAlignment="Stretch"
|
2026-02-23 11:21:51 +08:00
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
|
|
Fill="Gray" />
|
|
|
|
|
|
<GroupBox
|
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
Margin="5"
|
|
|
|
|
|
BorderThickness="0"
|
|
|
|
|
|
FontSize="16"
|
|
|
|
|
|
Foreground="DeepSkyBlue"
|
|
|
|
|
|
Header="获取授权"
|
|
|
|
|
|
Style="{x:Null}">
|
|
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition Width="2*" />
|
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<TextBox
|
|
|
|
|
|
x:Name="MachineCodeTextBox"
|
|
|
|
|
|
ui:ControlHelper.Header="机器码:"
|
|
|
|
|
|
ui:ControlHelper.PlaceholderText="请输入硬件机器码,由CPU、主板、C盘所在磁盘构成"
|
|
|
|
|
|
ToolTip="硬件机器码由CPU、主板、C盘所在磁盘构成" />
|
|
|
|
|
|
<TextBox
|
|
|
|
|
|
x:Name="LicenseTextBox"
|
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
ui:ControlHelper.Header="授权激活码:"
|
|
|
|
|
|
ui:ControlHelper.PlaceholderText="授权激活码"
|
|
|
|
|
|
IsReadOnly="True" />
|
|
|
|
|
|
<DatePicker
|
|
|
|
|
|
x:Name="ExpiryDatePicker"
|
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
|
|
ui:ControlHelper.Header="授权到期日期:" />
|
|
|
|
|
|
<UniformGrid
|
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
|
VerticalAlignment="Bottom"
|
|
|
|
|
|
Rows="1">
|
|
|
|
|
|
<Button HorizontalAlignment="Stretch" Click="LicenseClick">
|
|
|
|
|
|
<ui:IconAndText Content="获取激活码" Icon="{x:Static ui:SegoeFluentIcons.Calculator}" />
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button HorizontalAlignment="Stretch" Click="SaveLicenseClick">
|
|
|
|
|
|
<ui:IconAndText Content="保存激活码" Icon="{x:Static ui:SegoeFluentIcons.SaveLocal}" />
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</UniformGrid>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</GroupBox>
|
|
|
|
|
|
<Rectangle
|
|
|
|
|
|
Grid.Row="2"
|
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
Height="1"
|
2026-01-16 17:07:43 +08:00
|
|
|
|
HorizontalAlignment="Stretch"
|
2026-02-23 11:21:51 +08:00
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
|
|
Fill="Gray" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</TabItem>
|
|
|
|
|
|
<TabItem ui:TabItemHelper.IsClosable="False" Header="应急动态码计算">
|
|
|
|
|
|
<Grid Margin="5">
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<UniformGrid Rows="1">
|
|
|
|
|
|
<ComboBox
|
|
|
|
|
|
x:Name="DynamicDurationComboBox"
|
|
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
|
ui:ControlHelper.Header="授权时长:">
|
|
|
|
|
|
<ComboBoxItem
|
|
|
|
|
|
Content="1天"
|
|
|
|
|
|
IsSelected="True"
|
|
|
|
|
|
Tag="1D" />
|
|
|
|
|
|
<ComboBoxItem Content="7天" Tag="7D" />
|
|
|
|
|
|
<ComboBoxItem Content="30天" Tag="30D" />
|
|
|
|
|
|
</ComboBox>
|
|
|
|
|
|
<TextBox
|
|
|
|
|
|
x:Name="SaltTextBox"
|
|
|
|
|
|
ui:ControlHelper.Header="应急盐值(Emergency Salt):"
|
|
|
|
|
|
ui:ControlHelper.PlaceholderText="盐值,需要与UE中设置的一致" />
|
|
|
|
|
|
</UniformGrid>
|
|
|
|
|
|
<Grid Grid.Row="1">
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition />
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<TextBox
|
|
|
|
|
|
x:Name="DynamicLicenseTextBox"
|
|
|
|
|
|
ui:ControlHelper.Header="动态授权激活码:"
|
|
|
|
|
|
ui:ControlHelper.PlaceholderText="动态授权激活码"
|
|
|
|
|
|
IsReadOnly="True" />
|
|
|
|
|
|
<Button
|
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
|
VerticalAlignment="Bottom"
|
|
|
|
|
|
Click="DynamicLicenseClick">
|
|
|
|
|
|
<ui:IconAndText Content="计算动态激活码" Icon="{x:Static ui:SegoeFluentIcons.Calculator}" />
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</TabItem>
|
|
|
|
|
|
</TabControl>
|
2026-01-16 17:07:43 +08:00
|
|
|
|
<TextBox
|
|
|
|
|
|
x:Name="Message"
|
|
|
|
|
|
Grid.Row="2"
|
|
|
|
|
|
ui:ControlHelper.Header="消息:"
|
|
|
|
|
|
Foreground="LightCoral" />
|
2026-02-23 11:21:51 +08:00
|
|
|
|
<ui:ToggleSwitch
|
|
|
|
|
|
x:Name="ToggleButton"
|
|
|
|
|
|
MinWidth="80"
|
|
|
|
|
|
Margin="5,0"
|
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
|
|
ui:OffContent="浅色"
|
|
|
|
|
|
ui:OnContent="深色"
|
|
|
|
|
|
Toggled="ToggleTheme_Click" />
|
2026-01-16 17:07:43 +08:00
|
|
|
|
</Grid>
|
2026-02-23 11:21:51 +08:00
|
|
|
|
|
2026-01-16 17:07:43 +08:00
|
|
|
|
</Window>
|