1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace SysSecLibs
- {
- public class MySecurity
- {
- public static bool IsMachineValidated()
- {
- bool lbRetVal = false;
- if (!lbRetVal)
- {
- string text1 = FileFuns.ReadSystemLicense();
- Array array1 = Utils.StrToArrayEx(text1, "\r\n");
- string text2 = "";
- string text3 = "";
- foreach (string text4 in array1)
- {
- if (text4 != "")
- {
- Array array2 = Utils.StrToArray(text4);
- string text5 = array2.GetValue(0).ToString();
- string text6 = "";
- if ((array2.Length == 2) && (text5 == ""))
- {
- text5 = array2.GetValue(1).ToString();
- if (text2 == "")
- {
- text2 = Utils. GetCpuId();
- }
- text6 = text2;
- }
- else
- {
- if (text3 == "")
- {
- text3 = Utils.GetMachineMac();
- }
- text6 = text3;
- }
- lbRetVal = CheckMachineIds(text5, text6);
- }
- if (lbRetVal)
- {
- break;
- }
- }
- }
- return lbRetVal;
- }
- private static bool CheckMachineIds(string pcMachineId, string pcHardWardIds)
- {
- bool lbRetVal = false;
- Array array1 = Utils.StrToArray(pcHardWardIds);
- foreach (string text1 in array1)
- {
- if (text1 == pcMachineId)
- {
- return true;
- }
- }
- return lbRetVal;
- }
- }
- }
|