注释启动验证

Test.EIImageViewer
hang 2023-08-10 11:04:48 +08:00
parent 37f893f27e
commit bd9fe11759
1 changed files with 31 additions and 31 deletions

View File

@ -76,50 +76,50 @@ namespace IRaCIS.Core.API
#region ÈÏÖ¤³ÌÐò #region ÈÏÖ¤³ÌÐò
if (!File.Exists($@"C:\ProgramData\.xingcang\config.json")) //if (!File.Exists($@"C:\ProgramData\.xingcang\config.json"))
{ //{
Console.WriteLine("当前未注册"); // Console.WriteLine("当前未注册");
Log.Logger.Error("当前未注册"); // Log.Logger.Error("当前未注册");
Console.ReadLine(); // Console.ReadLine();
return; // return;
} //}
else //else
{ //{
var json = File.ReadAllText($@"C:\ProgramData\.xingcang\config.json"); // var json = File.ReadAllText($@"C:\ProgramData\.xingcang\config.json");
JObject jsonObject = JObject.Parse(json); // JObject jsonObject = JObject.Parse(json);
var key = jsonObject["key"].ToString(); // var key = jsonObject["key"].ToString();
var value = jsonObject["value"].ToString(); // var value = jsonObject["value"].ToString();
var physicalAddressList = NetworkInterface.GetAllNetworkInterfaces().Select(t => t.GetPhysicalAddress().ToString()); // var physicalAddressList = NetworkInterface.GetAllNetworkInterfaces().Select(t => t.GetPhysicalAddress().ToString());
// 判断文件里面的机器码是否是本机的 // // 判断文件里面的机器码是否是本机的
if (!physicalAddressList.Contains(key)) // if (!physicalAddressList.Contains(key))
{ // {
Console.WriteLine("机器码和本机不对应"); // Console.WriteLine("机器码和本机不对应");
Log.Logger.Error("机器码和本机不对应"); // Log.Logger.Error("机器码和本机不对应");
Console.ReadLine(); // Console.ReadLine();
return; // return;
} // }
var secrete = MD5Helper.Md5($"{key}_XINGCANG"); // var secrete = MD5Helper.Md5($"{key}_XINGCANG");
if (value != secrete) // if (value != secrete)
{ // {
Console.WriteLine("机器码和注册码不匹配"); // Console.WriteLine("机器码和注册码不匹配");
Log.Logger.Error("机器码和注册码不匹配"); // Log.Logger.Error("机器码和注册码不匹配");
Console.ReadLine(); // Console.ReadLine();
return; // return;
} // }
} //}
#endregion #endregion