|
@@ -14,48 +14,59 @@ namespace OTSMeasureApp
|
|
|
|
|
|
public bool RegistrationVerification()
|
|
|
{
|
|
|
- string CPUID, DiskID;
|
|
|
+
|
|
|
try
|
|
|
{
|
|
|
+ //if (!checkRegistration())//文件授权法
|
|
|
+ //{
|
|
|
+ // return false;
|
|
|
+
|
|
|
+ //}
|
|
|
+ //狗加密法
|
|
|
SenseShield.DogDecrypting.decrypting(101);//参数为许可号
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- CPUID = getCpu();
|
|
|
- DiskID = GetDiskVolumeSerialNumber();
|
|
|
- var ID = ReadXML("./Config/SysData/RegistrationProofreading.txt");
|
|
|
- if (ID.Count == 0)
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
- List<string> list_str = new List<string>();
|
|
|
- List<string> list_time = new List<string>();
|
|
|
- ID.TryGetValue("ID", out list_str);
|
|
|
- ID.TryGetValue("Time", out list_time);
|
|
|
- string setCPU = ConvertString(list_str[0]);
|
|
|
- string setDisk = ConvertString(list_str[1]);
|
|
|
- string setYear = ConvertString(list_time[0]);
|
|
|
- string setMonth = ConvertString(list_time[1]);
|
|
|
- string setDay = ConvertString(list_time[2]);
|
|
|
- if (CPUID != setCPU || DiskID != setDisk)
|
|
|
- {
|
|
|
- return false;
|
|
|
|
|
|
- }
|
|
|
+ return false;
|
|
|
|
|
|
- DateTime dt = DateTime.ParseExact(setYear + setMonth + setDay + "235959", "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ private bool checkRegistration()
|
|
|
+ {
|
|
|
+ string CPUID, DiskID;
|
|
|
+ CPUID = getCpu();
|
|
|
+ DiskID = GetDiskVolumeSerialNumber();
|
|
|
+ var ID = ReadXML("./Config/SysData/RegistrationProofreading.txt");
|
|
|
+ if (ID.Count == 0)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ List<string> list_str = new List<string>();
|
|
|
+ List<string> list_time = new List<string>();
|
|
|
+ ID.TryGetValue("ID", out list_str);
|
|
|
+ ID.TryGetValue("Time", out list_time);
|
|
|
+ string setCPU = ConvertString(list_str[0]);
|
|
|
+ string setDisk = ConvertString(list_str[1]);
|
|
|
+ string setYear = ConvertString(list_time[0]);
|
|
|
+ string setMonth = ConvertString(list_time[1]);
|
|
|
+ string setDay = ConvertString(list_time[2]);
|
|
|
+ if (CPUID != setCPU || DiskID != setDisk)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
|
|
|
- if (DateTime.Now > dt)
|
|
|
- {
|
|
|
+ }
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
+ DateTime dt = DateTime.ParseExact(setYear + setMonth + setDay + "235959", "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture);
|
|
|
|
|
|
+ if (DateTime.Now > dt)
|
|
|
+ {
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
|
|
|
// 获得CPU的序列号
|