[C#] 纯文本查看 复制代码
private void method_0(object sender, EventArgs e)
{
ProjectData.ClearProjectError();
if (Class18.bool_16)
{
base.Close();
}
else if (Strings.Len(Class15.string_1) == 0)
{
Interaction.MsgBox("机器码不能为空,如不能解决,请与南方联系。", MsgBoxStyle.OkOnly, null);
}
else
{
Conversions.ToString(Class1.smethod_0().Registry.GetValue("HKEY_CURRENT_USER\Software\NanfangSoft .net\ProName730", "PCNB", ""));
string text = Strings.Trim(this.vmethod_2().Text);
string text2 = Strings.Trim(this.vmethod_6().Text);
if ((text2.Length < 14) | (text2.Length > 15)) //长度15位
{
this.vmethod_0().Text = "注册码不对!";
}
else
{
string text3 = Strings.Mid(text2, 1, 4) + Strings.Mid(text2, 9, 4);
string text4 = Strings.Mid(text2, 5, 1);
string text5 = Strings.Mid(text2, 6, 1);
string text6 = Strings.Mid(text2, 7, 1);
string text7 = Strings.Mid(text2, 8, 1);
string text8 = Strings.Mid(text2, 13, 1);
string str = Strings.Mid(text2, 14, 1);
if ((Operators.CompareString(text4, "6", false) == 0) | (Operators.CompareString(text4, "7", false) == 0) | (Operators.CompareString(text4, "B", false) == 0))
{
text4 = "1";
}
if ((Operators.CompareString(text4, "8", false) == 0) | (Operators.CompareString(text4, "9", false) == 0) | (Operators.CompareString(text4, "C", false) == 0))
{
text4 = "2";
}
if (Operators.CompareString(text5, "A", false) == 0)
{
text5 = "0";
}
if (Operators.CompareString(text5, "B", false) == 0)
{
text5 = "1";
}
if (Operators.CompareString(text5, "C", false) == 0)
{
text5 = "2";
}
if (Operators.CompareString(text5, "D", false) == 0)
{
text5 = "3";
}
if (Operators.CompareString(text5, "E", false) == 0)
{
text5 = "4";
}
if (Operators.CompareString(text5, "F", false) == 0)
{
text5 = "5";
}
if (Operators.CompareString(text5, "G", false) == 0)
{
text5 = "6";
}
if (Operators.CompareString(text5, "H", false) == 0)
{
text5 = "7";
}
if (Operators.CompareString(text5, "J", false) == 0)
{
text5 = "8";
}
if (Operators.CompareString(text5, "K", false) == 0)
{
text5 = "9";
}
string value = "20" + text4 + text5;//5、6位组成年份
if ((Operators.CompareString(text6, "6", false) == 0) | (Operators.CompareString(text6, "7", false) == 0) | (Operators.CompareString(text6, "B", false) == 0))
{
text6 = "1";
}
if ((Operators.CompareString(text6, "4", false) == 0) | (Operators.CompareString(text6, "5", false) == 0) | (Operators.CompareString(text6, "A", false) == 0))
{
text6 = "0";
}
if (Operators.CompareString(text7, "A", false) == 0)
{
text7 = "0";
}
if (Operators.CompareString(text7, "B", false) == 0)
{
text7 = "1";
}
if (Operators.CompareString(text7, "C", false) == 0)
{
text7 = "2";
}
if (Operators.CompareString(text7, "D", false) == 0)
{
text7 = "3";
}
if (Operators.CompareString(text7, "E", false) == 0)
{
text7 = "4";
}
if (Operators.CompareString(text7, "F", false) == 0)
{
text7 = "5";
}
if (Operators.CompareString(text7, "G", false) == 0)
{
text7 = "6";
}
if (Operators.CompareString(text7, "H", false) == 0)
{
text7 = "7";
}
if (Operators.CompareString(text7, "J", false) == 0)
{
text7 = "8";
}
if (Operators.CompareString(text7, "K", false) == 0)
{
text7 = "9";
}
string value2 = text6 + text7;//7、8位组成月份
if (Operators.CompareString(text8, "A", false) == 0)
{
text8 = "0";
}
if (Operators.CompareString(text8, "B", false) == 0)
{
text8 = "1";
}
if (Operators.CompareString(text8, "C", false) == 0)
{
text8 = "2";
}
string value3 = text8 + str;//13、14位组成日
if (((text2.Length == 15) & ((Operators.CompareString(Strings.Mid(text2, 15, 1), "1", false) == 0) | (Operators.CompareString(Strings.Mid(text2, 15, 1), "2", false) == 0))) && Class1.smethod_0().FileSystem.FileExists(Class20.string_8 + "\syspnam730.dll"))
{
Class1.smethod_0().FileSystem.DeleteFile(Class20.string_8 + "\syspnam730.dll");
}
int num = Conversions.ToInteger(value);//年 <=2030
int num2 = Conversions.ToInteger(value2);//月 1-12
int num3 = Conversions.ToInteger(value3);//日 1-28
if ((num3 < 1) | (num3 > 28) | (num < 2013) | (num > 2030) | (num2 < 1) | (num2 > 12) | (num < DateAndTime.Now.Year) | ((num == DateAndTime.Now.Year) & (num2 < DateAndTime.Now.Month)))
{
this.vmethod_0().Text = "注册码不对!";
}
else if (this.short_0 == 1)
{
this.method_1(this.vmethod_8(), new EventArgs());
}
else if (Strings.Len(Strings.Trim(this.vmethod_4().Text)) == 0)
{
this.vmethod_0().Text = "您没有输入姓名。";
}
else if (Strings.Len(text3) == 0)
{
this.vmethod_0().Text = "您没有输入注册码。";
}
//机器码和注册码比较
else if (Class18.smethod_3(ref text, ref text3) & !File.Exists(Class20.string_8 + "\syspnam730.dll"))
{
Class1.smethod_0().Registry.SetValue("HKEY_CURRENT_USER\Software\NanfangSoft .net\ProName730", "Name", this.vmethod_4().Text);
string text9 = Strings.UCase(text3);
Class20.smethod_11(ref text, ref text9, ref value, ref value2, ref value3);
Class20.bool_0 = true;
this.vmethod_0().Text = "注册成功!点击'退出',您现在可以使用本程序了。";
}
else
{
this.vmethod_0().Text = "注册码不对!";
}
}
}
int num4;
if (num4 != 0)
{
ProjectData.ClearProjectError();
}
}