159 lines
6.2 KiB
Plaintext
159 lines
6.2 KiB
Plaintext
|
|
<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" />
|
|||
|
|
<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
|
|||
|
|
x:Name="ToggleButton"
|
|||
|
|
Grid.Row="1"
|
|||
|
|
Grid.Column="0"
|
|||
|
|
Click="Button_ToggleTheme_Click"
|
|||
|
|
Content="明暗切换" />
|
|||
|
|
<Button
|
|||
|
|
Grid.Row="1"
|
|||
|
|
Grid.Column="0"
|
|||
|
|
Margin="5"
|
|||
|
|
HorizontalAlignment="Right"
|
|||
|
|
Click="ImportPrivateKeyClick"
|
|||
|
|
Content="导入文件私钥" />
|
|||
|
|
<UniformGrid
|
|||
|
|
Grid.Row="1"
|
|||
|
|
Grid.Column="1"
|
|||
|
|
HorizontalAlignment="Right"
|
|||
|
|
Rows="1">
|
|||
|
|
<Button Click="GenerateKeyClick" Content="计算公私密钥" />
|
|||
|
|
<Button Click="SaveKeysClick" Content="保存公私密钥" />
|
|||
|
|
</UniformGrid>
|
|||
|
|
</Grid>
|
|||
|
|
</GroupBox>
|
|||
|
|
<Rectangle
|
|||
|
|
Grid.Row="1"
|
|||
|
|
Grid.Column="0"
|
|||
|
|
Height="1"
|
|||
|
|
HorizontalAlignment="Stretch"
|
|||
|
|
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"
|
|||
|
|
Rows="1">
|
|||
|
|
<Button
|
|||
|
|
HorizontalAlignment="Stretch"
|
|||
|
|
Click="LicenseClick"
|
|||
|
|
Content="获取激活码" />
|
|||
|
|
<Button
|
|||
|
|
HorizontalAlignment="Stretch"
|
|||
|
|
Click="SaveLicenseClick"
|
|||
|
|
Content="保存激活码" />
|
|||
|
|
</UniformGrid>
|
|||
|
|
</Grid>
|
|||
|
|
</GroupBox>
|
|||
|
|
<Rectangle
|
|||
|
|
Grid.Row="2"
|
|||
|
|
Grid.Column="0"
|
|||
|
|
Height="1"
|
|||
|
|
HorizontalAlignment="Stretch"
|
|||
|
|
VerticalAlignment="Top"
|
|||
|
|
Fill="Gray" />
|
|||
|
|
<TextBox
|
|||
|
|
x:Name="Message"
|
|||
|
|
Grid.Row="2"
|
|||
|
|
ui:ControlHelper.Header="消息:"
|
|||
|
|
Foreground="LightCoral" />
|
|||
|
|
|
|||
|
|
</Grid>
|
|||
|
|
</Window>
|