diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 2384ed9..a6a84cf 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; +using System.Threading; using System.Windows; using System.Windows.Controls; using System.Windows.Data; @@ -105,24 +106,22 @@ namespace SUNLIGHT_CDKEY private void Button_Click(object sender, RoutedEventArgs e) { - string a; string b, my, mm, md; - if (sn_id.Text == "") return; + if (sn_id.Text.Length <6) + { + 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(0, 6); + a = sn_id.Text.Substring(0, 6); 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; - - a= sn_id.Text.Substring(0, 6); - b=(2255-y).ToString()+(255-m).ToString()+(255-d).ToString(); - - cdk.Text = a + b + CRCcheck16.ToCRC16(CRCcheck16.StringToHexByte(b), true); }