Compare commits

..
10 Commits
Author SHA1 Message Date
sc 3cc75a4d51 Merge branch 'master' of http://192.168.0.12:13000/sc/SUNLIGHT_CDKEY 2024-03-30 22:22:01 +08:00
sc dd8bedf452 Merge branch 'master' of http://www.scserverddns.top:13000/sc/sunlight_cdkey 2024-03-30 22:22:00 +08:00
sc 4e9fb61ff0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/sunlight_cdkey 2024-03-29 23:16:53 +08:00
sc 1a7669f1bf key 2024-03-29 23:16:50 +08:00
sc 4e40658493 key 2024-03-29 23:15:46 +08:00
sc 608f121b5d key 2024-03-29 23:15:14 +08:00
sc 6b06bb643e key 2024-03-29 23:14:40 +08:00
sc 60bc8223b0 KEY 2024-03-29 23:14:20 +08:00
sc b8878d4223 KEY 2024-03-29 23:02:22 +08:00
sc eadb411c73 CDKEY 2024-03-29 23:01:14 +08:00
2 changed files with 29 additions and 5 deletions

No files matched your search

+2 -1
View File
@@ -8,7 +8,8 @@
Title="SUNLIGHT_CDKEY" Height="400" Width="600"> Title="SUNLIGHT_CDKEY" Height="400" Width="600">
<Grid> <Grid>
<TextBlock HorizontalAlignment="Left" Height="40" Margin="20,10,0,0" TextWrapping="Wrap" Text="SN:" VerticalAlignment="Top" Width="170" FontSize="24"/> <TextBlock HorizontalAlignment="Left" Height="40" Margin="20,10,0,0" TextWrapping="Wrap" Text="SN:" VerticalAlignment="Top" Width="170" FontSize="24"/>
<TextBox x:Name="sn_id" HorizontalAlignment="Left" Height="40" Margin="170,10,0,0" VerticalAlignment="Top" Width="340" FontSize="24"/> <TextBox x:Name="sn_id" HorizontalAlignment="Left" Height="40" Margin="170,10,0,0" VerticalAlignment="Top" Width="340" FontSize="24"
PreviewTextInput="AlphanumericValidationTextBox" InputMethod.IsInputMethodEnabled="False"/>
<TextBlock HorizontalAlignment="Left" Height="40" Margin="20,55,0,0" TextWrapping="Wrap" Text="DURATION:" VerticalAlignment="Top" Width="170" FontSize="24"/> <TextBlock HorizontalAlignment="Left" Height="40" Margin="20,55,0,0" TextWrapping="Wrap" Text="DURATION:" VerticalAlignment="Top" Width="170" FontSize="24"/>
<TextBlock HorizontalAlignment="Left" Height="40" Margin="400,55,0,0" TextWrapping="Wrap" Text="MONTHS" VerticalAlignment="Top" Width="170" FontSize="24"/> <TextBlock HorizontalAlignment="Left" Height="40" Margin="400,55,0,0" TextWrapping="Wrap" Text="MONTHS" VerticalAlignment="Top" Width="170" FontSize="24"/>
<ComboBox x:Name="DURATION" HorizontalAlignment="Left" Height="40" Margin="170,55,0,0" VerticalAlignment="Top" Width="220" DropDownClosed="DURATION_DropDownClosed" FontSize="24"> <ComboBox x:Name="DURATION" HorizontalAlignment="Left" Height="40" Margin="170,55,0,0" VerticalAlignment="Top" Width="220" DropDownClosed="DURATION_DropDownClosed" FontSize="24">
+27 -4
View File
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data; using System.Windows.Data;
@@ -30,6 +31,15 @@ namespace SUNLIGHT_CDKEY
T_M.Text = DateTime.Now.ToString("MM"); T_M.Text = DateTime.Now.ToString("MM");
T_D.Text = DateTime.Now.ToString("dd"); T_D.Text = DateTime.Now.ToString("dd");
} }
private void AlphanumericValidationTextBox(object sender, TextCompositionEventArgs e)
{
Regex regex = new Regex(@"[^a-eA-E0-9]+$");
e.Handled = regex.IsMatch(e.Text.ToUpper());
}
private void validation_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Space) e.Handled = true;
}
private void Tb_KeyFloating_D(object sender, TextCompositionEventArgs e)//输入事件 private void Tb_KeyFloating_D(object sender, TextCompositionEventArgs e)//输入事件
{ {
@@ -108,11 +118,24 @@ namespace SUNLIGHT_CDKEY
string a; string a;
string b, my, mm, md; string b, my, mm, md;
if (sn_id.Text == "") return; sn_id.Text = sn_id.Text.ToUpper();
a= sn_id.Text.Substring(0, 6); if (sn_id.Text.Length < 6)//id字节长度大于6有效
b=(2255-y).ToString()+(255-m).ToString()+(255-d).ToString(); {
>>>>>>>>> Temporary merge branch 2 sn_id.BorderBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0, 0));
return;
}
else
{
sn_id.BorderBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 255, 255));
}
a= sn_id.Text.Substring(5, 1)+ sn_id.Text.Substring(0, 1)+ sn_id.Text.Substring(4, 1) + sn_id.Text.Substring(1, 1) + sn_id.Text.Substring(3, 1)+ sn_id.Text.Substring(2, 1);
my = Convert.ToString(Convert.ToInt32(2255 - y), 16).ToUpper();
mm = Convert.ToString(Convert.ToInt32(255 - m), 16).ToUpper();
md = Convert.ToString(Convert.ToInt32(255-d), 16).ToUpper();
b=my+mm+md;
cdk.Text = a + b + CRCcheck16.ToCRC16(CRCcheck16.StringToHexByte(b), true); cdk.Text = a + b + CRCcheck16.ToCRC16(CRCcheck16.StringToHexByte(b), true);
} }