许可证安全检查逻辑调整
This commit is contained in:
commit
d3a021dcf0
3 files changed
+43
-23
No files matched your search
+6
-6
@@ -217,12 +217,12 @@
|
|||||||
<ContentControl x:Name="Deputy"/>
|
<ContentControl x:Name="Deputy"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid Grid.Column="1" Margin="0,0,0,0" Background="White" Opacity="0.8" Visibility="{Binding Cdk_page}">
|
<Grid Grid.Column="1" Margin="0,0,0,0" Background="White" Visibility="{Binding Cdk_page}" Opacity="0.8">
|
||||||
<TextBlock Height="50" Margin="0,0,0,300" TextWrapping="Wrap" Text="The registration code expires" Width="500" FontSize="34" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
<TextBlock Height="150" Margin="0,0,0,300" TextWrapping="Wrap" Text="注册信息到期,处理注册信息预计需要3个工作日,为避免影响系统使用请及时提交注册信息!" Width="500" FontSize="34" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||||
<TextBlock Height="50" Margin="0,0,0,200" TextWrapping="Wrap" Text="{Binding Cdk_time}" Width="500" FontSize="34" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
<TextBlock Height="50" Margin="0,0,0,100" TextWrapping="Wrap" Text="{Binding Cdk_time}" Width="500" FontSize="34" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Red"/>
|
||||||
<TextBlock Height="50" Margin="0,0,0,100" TextWrapping="Wrap" Text="Contact SUNLIGHT Reactivate" Width="500" FontSize="34" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
<TextBlock Height="50" Margin="0,0,0,0" TextWrapping="Wrap" Text="请联系 SUNLIGHT" Width="300" FontSize="34" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||||
<Button Content="Reactivate" HorizontalAlignment="Center" Height="50" Margin="200,100,0,0" VerticalAlignment="Center" Width="150" FontSize="24" BorderBrush="{x:Null}" Background="#FFDFDFDF" Click="CDKEY_SET"/>
|
<Button Content="激活" HorizontalAlignment="Center" Height="50" Margin="200,100,0,-100" VerticalAlignment="Center" Width="150" FontSize="24" BorderBrush="{x:Null}" Background="#FFDFDFDF" Click="CDKEY_SET"/>
|
||||||
<Button Content="Contact" HorizontalAlignment="Center" Height="50" Margin="0,100,200,0" VerticalAlignment="Center" Width="150" FontSize="24" BorderBrush="{x:Null}" Background="#FFDFDFDF" Click="HELP"/>
|
<Button Content="帮助" HorizontalAlignment="Center" Height="50" Margin="0,100,200,-100" VerticalAlignment="Center" Width="150" FontSize="24" BorderBrush="{x:Null}" Background="#FFDFDFDF" Click="HELP"/>
|
||||||
<TextBlock Height="50" Margin="0,0,0,0" TextWrapping="Wrap" Text="{Binding Cdk_pageT}" Width="500" FontSize="34" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
|
<TextBlock Height="50" Margin="0,0,0,0" TextWrapping="Wrap" Text="{Binding Cdk_pageT}" Width="500" FontSize="34" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ namespace formula_manage.ViewModel
|
|||||||
string SN_KEY;
|
string SN_KEY;
|
||||||
|
|
||||||
private void CDkey_()
|
private void CDkey_()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
string id_1 = SN_ID.Substring(5, 1) + SN_ID.Substring(0, 1) + SN_ID.Substring(4, 1) + SN_ID.Substring(1, 1) + SN_ID.Substring(3, 1) + SN_ID.Substring(2, 1);
|
string id_1 = SN_ID.Substring(5, 1) + SN_ID.Substring(0, 1) + SN_ID.Substring(4, 1) + SN_ID.Substring(1, 1) + SN_ID.Substring(3, 1) + SN_ID.Substring(2, 1);
|
||||||
if ((id_1 == SN_KEY.Substring(0, 6)) && (SN_KEY.Length == 16))
|
if ((id_1 == SN_KEY.Substring(0, 6)) && (SN_KEY.Length == 16))
|
||||||
@@ -102,7 +104,7 @@ namespace formula_manage.ViewModel
|
|||||||
string MM = DateTime.Now.ToString("MM");
|
string MM = DateTime.Now.ToString("MM");
|
||||||
string DD = DateTime.Now.ToString("dd");
|
string DD = DateTime.Now.ToString("dd");
|
||||||
|
|
||||||
Cdk_time = "Expires time: " + Y +"/"+ M +"/"+ D;
|
Cdk_time = "注册到期时间: " + Y + "/" + M + "/" + D;
|
||||||
|
|
||||||
if (string.Compare(Y, YY) < 0)
|
if (string.Compare(Y, YY) < 0)
|
||||||
{
|
{
|
||||||
@@ -113,16 +115,31 @@ namespace formula_manage.ViewModel
|
|||||||
Cdk_page = "Visible";
|
Cdk_page = "Visible";
|
||||||
//cdk_pageT_T = -1; //防止触发倒计时
|
//cdk_pageT_T = -1; //防止触发倒计时
|
||||||
}
|
}
|
||||||
else if ((int.Parse(D) - int.Parse(DD)) <= 3)//提前三天提醒
|
else if ((int.Parse(D) - int.Parse(DD)) <= 10)//提前三天提醒
|
||||||
{
|
{
|
||||||
Cdk_page = "Visible";
|
Cdk_page = "Visible";
|
||||||
cdk_pageT_T = 60; //页面关闭倒计时30秒
|
cdk_pageT_T = 180; //页面关闭倒计时30秒
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Cdk_page = "Visible";
|
||||||
|
Cdk_time = "许可证安全校验错误请重新激活";
|
||||||
|
} }
|
||||||
|
else
|
||||||
|
|
||||||
|
{
|
||||||
|
Cdk_page = "Visible";
|
||||||
|
Cdk_time = "计算机信息变更当前许可证失效";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
Cdk_page = "Visible";
|
||||||
|
Cdk_time = "许可证安全校验错误请重新激活";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void Sql_()
|
private async void Sql_()
|
||||||
|
|||||||
+17
-14
@@ -43,11 +43,14 @@ namespace formula_manage.Windows
|
|||||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
|
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
|
||||||
cdk.Text = Configini.IniReadvalue("SN", "SN1"); //读配置文件
|
cdk.Text = Configini.IniReadvalue("SN", "SN1"); //读配置文件
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
string Y = (2255 - StrToInt.To16Convert10(cdk.Text.Substring(6, 2))).ToString();
|
string Y = (2255 - StrToInt.To16Convert10(cdk.Text.Substring(6, 2))).ToString();
|
||||||
string M = (255 - StrToInt.To16Convert10(cdk.Text.Substring(8, 2))).ToString();
|
string M = (255 - StrToInt.To16Convert10(cdk.Text.Substring(8, 2))).ToString();
|
||||||
string D = (255 - StrToInt.To16Convert10(cdk.Text.Substring(10, 2))).ToString();
|
string D = (255 - StrToInt.To16Convert10(cdk.Text.Substring(10, 2))).ToString();
|
||||||
sn_time.Text = "CDkeyDueTime: " + Y + "-" + M + "-" + D;
|
sn_time.Text = "注册有效时间: " + Y + "-" + M + "-" + D;
|
||||||
|
}
|
||||||
|
catch (Exception ex) { }
|
||||||
// 获取CPU序列号
|
// 获取CPU序列号
|
||||||
cpuSerialNumber = HardwareSN.GetCPUSerialNumber();
|
cpuSerialNumber = HardwareSN.GetCPUSerialNumber();
|
||||||
// 获取主板序列号
|
// 获取主板序列号
|
||||||
@@ -56,8 +59,8 @@ namespace formula_manage.Windows
|
|||||||
//string hardDiskSerialNumber = HardwareSN.GetHardDiskSerialNumber();
|
//string hardDiskSerialNumber = HardwareSN.GetHardDiskSerialNumber();
|
||||||
// 获取网卡地址
|
// 获取网卡地址
|
||||||
//string netCardMACAddress = HardwareSN.GetNetCardMACAddress();
|
//string netCardMACAddress = HardwareSN.GetNetCardMACAddress();
|
||||||
|
|
||||||
sn_id.Text = MD5check.MD5Encrypt16(cpuSerialNumber+ biosSerialNumber);//生成id基于硬件值的md5校验
|
sn_id.Text = MD5check.MD5Encrypt16(cpuSerialNumber+ biosSerialNumber);//生成id基于硬件值的md5校验
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button_Click_2(object sender, RoutedEventArgs e) //cdk确认按钮
|
private void Button_Click_2(object sender, RoutedEventArgs e) //cdk确认按钮
|
||||||
@@ -83,8 +86,8 @@ namespace formula_manage.Windows
|
|||||||
{
|
{
|
||||||
if (string.Compare(D, DD) >= 0)
|
if (string.Compare(D, DD) >= 0)
|
||||||
{
|
{
|
||||||
System.Windows.MessageBox.Show("CDKEY: OK","KEY",MessageBoxButton.OK,MessageBoxImage.Asterisk);
|
System.Windows.MessageBox.Show("CDKEY: 注册成功,请重启软件", "KEY",MessageBoxButton.OK,MessageBoxImage.Asterisk);
|
||||||
sn_time.Text = "CDkeyDueTime: " + Y + "-" + M + "-" + D;
|
sn_time.Text = "注册有效时间: " + Y + "-" + M + "-" + D;
|
||||||
|
|
||||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
|
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
|
||||||
Configini.IniWritevalue("SN", " SN1", cdk.Text);
|
Configini.IniWritevalue("SN", " SN1", cdk.Text);
|
||||||
@@ -92,8 +95,8 @@ namespace formula_manage.Windows
|
|||||||
}
|
}
|
||||||
else if (string.Compare(M, MM) > 0)
|
else if (string.Compare(M, MM) > 0)
|
||||||
{
|
{
|
||||||
System.Windows.MessageBox.Show("CDKEY: OK", "KEY", MessageBoxButton.OK, MessageBoxImage.Asterisk);
|
System.Windows.MessageBox.Show("CDKEY: 注册成功,请重启软件", "KEY", MessageBoxButton.OK, MessageBoxImage.Asterisk);
|
||||||
sn_time.Text = "CDkeyDueTime: " + Y + "-" + M + "-" + D;
|
sn_time.Text = "注册有效时间: " + Y + "-" + M + "-" + D;
|
||||||
|
|
||||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
|
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
|
||||||
Configini.IniWritevalue("SN", " SN1", cdk.Text);
|
Configini.IniWritevalue("SN", " SN1", cdk.Text);
|
||||||
@@ -101,18 +104,18 @@ namespace formula_manage.Windows
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.Windows.MessageBox.Show("CDKEY: Overdue", "WARNING", MessageBoxButton.OK, MessageBoxImage.Warning);
|
System.Windows.MessageBox.Show("CDKEY: 注册码过期", "WARNING", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.Windows.MessageBox.Show("CDKEY: Overdue", "WARNING", MessageBoxButton.OK, MessageBoxImage.Warning);
|
System.Windows.MessageBox.Show("CDKEY: 注册码过期", "WARNING", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (string.Compare(Y, YY) > 0)
|
else if (string.Compare(Y, YY) > 0)
|
||||||
{
|
{
|
||||||
System.Windows.MessageBox.Show("CDKEY: OK", "KEY", MessageBoxButton.OK, MessageBoxImage.Asterisk);
|
System.Windows.MessageBox.Show("CDKEY: 注册成功,请重启软件", "KEY", MessageBoxButton.OK, MessageBoxImage.Asterisk);
|
||||||
sn_time.Text = "CDkeyDueTime: " + Y + "-" + M + "-" + D;
|
sn_time.Text = "注册有效时间: " + Y + "-" + M + "-" + D;
|
||||||
|
|
||||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
|
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
|
||||||
Configini.IniWritevalue("SN", " SN1", cdk.Text);
|
Configini.IniWritevalue("SN", " SN1", cdk.Text);
|
||||||
@@ -120,17 +123,17 @@ namespace formula_manage.Windows
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.Windows.MessageBox.Show("CDKEY: Overdue","WARNING",MessageBoxButton.OK,MessageBoxImage.Warning);
|
System.Windows.MessageBox.Show("CDKEY: 注册码过期","WARNING",MessageBoxButton.OK,MessageBoxImage.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.Windows.MessageBox.Show("CDKEY: Linvalid", "ERR", MessageBoxButton.OK, MessageBoxImage.Error);
|
System.Windows.MessageBox.Show("CDKEY: 无效注册码", "ERR", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.Windows.MessageBox.Show("CDKEY: Linvalid","ERR" , MessageBoxButton.OK,MessageBoxImage.Error);
|
System.Windows.MessageBox.Show("CDKEY: 无效注册码", "ERR" , MessageBoxButton.OK,MessageBoxImage.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user