[CODE][/CODE]AuthenticationMacAddress(String, Int32&, Int32&): Boolean:
------------------------------------------------------------------------------
private bool AuthenticationMacAddress(string strEncr, out int Xml_online_limit, out int Xml_enterprise_trunk_number)
{
Xml_enterprise_trunk_number = 0;
Xml_online_limit = 0;
try
{
strEncr = (strEncr.Length <= 6) ? strEncr : strEncr.Substring(0, strEncr.Length - 6);
Encrypter encrypter = new Encrypter();
string[] strArray = encrypter.Decrypto(strEncr).Split(new char[] { ';' });
Xml_enterprise_trunk_number = Convert.ToInt32(strArray[0]);
Xml_online_limit = Convert.ToInt32(strArray[1]);
string str2 = strArray[2];
if (str2 == "9999-99-99")
{
this.IsExtendProbation = false;
return true;
}
this.DtProbationTime = Convert.ToDateTime(str2);
this.IsExtendProbation = true;
return true;
}
catch (Exception)
{
new WriteLog().WriteGroupLog("验证注册码错误,#code206", 0);
}
return false;
}
代码:
private void yangzheng_Click(object sender, EventArgs e)
{
try
{
int num = 0;
int num2 = 0;
string str = "";
string str2 = "";
string str3 = "";
string str4 = "";
string str5 = "";
string str6 = "";
string str7 = "";
int num3 = 0;
int num4 = 0;
new ZhuceClass().GetRtxLices(out num, out num2, out str, out str2, out str3, out str4, out str5, out str6, out str7);
WriteLog log = new WriteLog();
if (num2 == 0)
{
log.WriteGroupLog("请申请许可后,再使用群插件", 0);
MessageBox.Show("请申请许可后,再使用群插件");
return;
}
if (this.AuthenticationMacAddress(this.txtyanzheng.Text.Trim(), out num3, out num4))
{
if (num4 != num2)
{
log.WriteGroupLog("群扩展服务启动失败,注册信息出错#code207", 0);
MessageBox.Show("注册失败,注册码错误");
return;
}
if ((num3 == num) || (num3 > num))
{
}
if (this.IsExtendProbation)
{
if (DateTime.Now >= this.DtProbationTime)
{
log.WriteGroupLog("试用期已结束!请申请注册码。", 0);
MessageBox.Show("试用期已结束!请申请注册码。");
return;
}
TimeSpan span = (TimeSpan) (this.DtProbationTime - DateTime.Now);
log.WriteGroupLog("版本为试用版.!还有 " + span.Days.ToString() + " 天试用期!到期时间:" + this.DtProbationTime.ToString("yyyy年MM月dd日"), 0);
MessageBox.Show("版本为试用版.!许可人数:" + num3.ToString() + "。还有 " + span.Days.ToString() + " 天试用期!到期时间:" + this.DtProbationTime.ToString("yyyy年MM月dd日"));
}
else
{
MessageBox.Show("版本为正式版.!许可人数:" + num3.ToString() + "。");
}
创建标志位XML文件(this.txtyanzheng.Text.Trim(), "Code", Application.StartupPath);
MessageBox.Show("验证码正确,可继续使用,请关闭插件服务器,重新启动后才生效!");
base.Close();
}
}
catch (Exception)
{
MessageBox.Show("验证码有误,请重新输入!");
this.txtyanzheng.Clear();
}
try
{
((GroupServerMes) base.Owner).检查code文件();
}
catch
{
}
}
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课