|
|
@ -31,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)//输入事件
|
|
|
{ |
|
|
{ |
|
|
@ -109,13 +118,19 @@ namespace SUNLIGHT_CDKEY |
|
|
string a; |
|
|
string a; |
|
|
string b, my, mm, md; |
|
|
string b, my, mm, md; |
|
|
|
|
|
|
|
|
|
|
|
sn_id.Text = sn_id.Text.ToUpper(); |
|
|
|
|
|
|
|
|
if (sn_id.Text.Length < 6)//id字节长度大于6有效
|
|
|
if (sn_id.Text.Length < 6)//id字节长度大于6有效
|
|
|
{ |
|
|
{ |
|
|
sn_id.BorderBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0, 0)); |
|
|
sn_id.BorderBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0, 0)); |
|
|
return; |
|
|
return; |
|
|
}else sn_id.BorderBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 255, 255)); |
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
sn_id.BorderBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 255, 255)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
a= sn_id.Text.Substring(0, 6); |
|
|
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(); |
|
|
my = Convert.ToString(Convert.ToInt32(2255 - y), 16).ToUpper(); |
|
|
mm = Convert.ToString(Convert.ToInt32(255 - m), 16).ToUpper(); |
|
|
mm = Convert.ToString(Convert.ToInt32(255 - m), 16).ToUpper(); |
|
|
|