public static void Main(string[] args) { string mCode = RegInfo.GetMachineCode(); //Console.WriteLine("机器码:" + mCode); string leiCode = "926843612593422649289458"; if(String.Equals(mCode,leiCode)) { Console.WriteLine(@"正在运行……"); Stopwatch sw = new Stopwatch(); sw.Start(); //开始计时 GBReport gb = new GBReport(); gb.Start(); sw.Stop(); Console.WriteLine("运行结束,用时{0}秒!按任意键结束", sw.Elapsed); } else { Console.WriteLine(@"程序未注册"); } Console.ReadKey(); }
static void Main(string[] args) { //string mac = DeviceHelper.GetCpuID(); //Console.WriteLine(mac); string mCode = RegInfo.GetMachineCode(); Console.WriteLine("机器码:" + mCode); DateTime overTime = DateTime.Now; string regCode = RegInfo.CreateRegisterCode(mCode, DateTime.Now); int year = int.Parse(overTime.Year.ToString().Substring(2)) + 33; int month = overTime.Month + 21; int day = overTime.Day + 54; int section = mCode.Length / 4; Console.WriteLine("注册码:" + regCode); Console.WriteLine(year); Console.WriteLine(month); Console.WriteLine(day); DateTime time = DateTime.Now; bool resu = RegInfo.CheckRegister(regCode, ref time); Console.WriteLine(resu); Console.ReadKey(); }