public static int GetUseTick(string info, string key, bool isdate) { int count = 0, error = 0; if (key.Length > 50) { string mw16 = MyEncrypt.GetMd5_16(info, true); string mw32 = MyEncrypt.GetMD5(info); string qian8 = key.Substring(0, 8); string num = MyEncrypt.FanZhuan(key.Substring(8, 4)); string zhong8 = key.Substring(12, 8); string date = MyEncrypt.DecryptB(MyEncrypt.FanZhuan(key.Substring(20, key.Length - 28))); mw16 = MyEncrypt.getRjCode(NumerStrToList(qian8), MyEncrypt.split(mw16)); mw32 = MyEncrypt.getRjCode(NumerStrToList(zhong8), MyEncrypt.split(mw32)); string str1 = mw16 + mw32; string str2 = key.Substring(key.Length - 8, 8); string today = DateTime.Now.Year + bu0(DateTime.Now.Month) + bu0(DateTime.Now.Day); Regex r = new Regex(@"^[0-9]*$"); int d1 = int.Parse(date); int d2 = int.Parse(today); if (!r.IsMatch(qian8)) { error++; } if (!r.IsMatch(zhong8)) { error++; } if (!r.IsMatch(date)) { error++; } if (!str1.Equals(str2)) { error++; } if (d1 > d2) { error++; } if (isdate && (d2 - d1) > 1) { error++; } if (error == 0) { num = MyEncrypt.CharToNumerStr(num); count = int.Parse(num); } else { count = count - error; } } return(count); }
public static string CreateKey(string info, string s) { string mw16 = MyEncrypt.GetMd5_16(info, true); string mw32 = MyEncrypt.GetMD5(info); List <int> i41 = MyEncrypt.GenerateNumber(4, 16); List <int> i42 = MyEncrypt.GenerateNumber(4, 32); mw16 = MyEncrypt.getRjCode(i41, MyEncrypt.split(mw16)); mw32 = MyEncrypt.getRjCode(i42, MyEncrypt.split(mw32)); string date = DateTime.Now.Year + bu0(DateTime.Now.Month) + bu0(DateTime.Now.Day); return(ListToString(i41) + MyEncrypt.FanZhuan(MyEncrypt.getNumChar(s)) + ListToString(i42) + MyEncrypt.FanZhuan(MyEncrypt.EncryptA(date)) + mw16 + mw32); }
private void button1_Click(object sender, EventArgs e) { String pwd = pwd_text.Text; String jqm = jiqima.Text; String zh = zh_text.Text; pwd = MyEncrypt.GetMd5_16(pwd, true); pwd = MyEncrypt.GetMD5(pwd); if (pwd.Equals(sap)) { errorInfo.ForeColor = Color.Green; errorInfo.Text = "生成成功!"; String text = TickCute.CreateKey(jqm, zh); textBox1.Text = text; Clipboard.SetData(DataFormats.Text, text); } else { errorInfo.ForeColor = Color.Red; errorInfo.Text = "错误!"; } }
private void button13_Click(object sender, EventArgs e) { Console.WriteLine(MyEncrypt.GetMD5(MyEncrypt.GetInfo())); Console.WriteLine(MyEncrypt.GetMd5_16(MyEncrypt.GetInfo(), true)); }
public Form1() { InitializeComponent(); 登录ToolStripMenuItem.Enabled = false; Control.CheckForIllegalCrossThreadCalls = false; richTextBox1.BackColor = Color.OliveDrab; richTextBox1.ForeColor = Color.White; Console.WriteLine("Environment.CurrentDirectory==" + Environment.CurrentDirectory); Trains.TrainsChanged += Trains_TrainsChanged; Seat.SelectSeatsChange += TrainSeat_SelectSeatsChange; Thread12306.ShowMessage += Thread12306_Message; TranTime.TimeChanged += TranTime_TimeChanged; Thread12306.ThreadClosed += Thread12306_ThreadClosed; ThreadPool.QueueUserWorkItem((n) => { Thread.Sleep(100); // 获取机器码 string info = MyEncrypt.GetInfo(); MachineCode = MyEncrypt.GetMd5_16(info, false); this.tstbJqm.Text = "机器码:" + MachineCode; //GetTickCount(); }); ThreadPool.QueueUserWorkItem((a) => { Thread.Sleep(2500); if (!String.IsNullOrEmpty(MachineCode)) { GetTickCount(); } }); ThreadPool.QueueUserWorkItem((m) => { ShowMessage("正在初始化...", false); _12306Class.GetMainPage(cookie: new CookieCollection()); ShowMessage("完成"); // 先获取车站信息 //var v = Stations.List; TickCute.CreateDir(); }); ThreadPool.QueueUserWorkItem((m) => { // 初始化配置 ConfigStore.InitConfig(); SetAutoBaojing(ConfigStore.isAutoBaojing); SetAutoWriterVerify(ConfigStore.isAutoWriterVerify); setFailedTimes(ConfigStore.failedTimes); button1.Enabled = ConfigStore.islocalhost; }); ThreadPool.QueueUserWorkItem((a) => { Thread.Sleep(3500); String dateStr = DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second; String s = "我的机器码:" + Form1.MachineCode + "\n"; s += "我使用了【隐心抢票助手】:" + dateStr + "\n"; CommonUtil.SendEMail("*****@*****.**", Form1.MachineCode, "*****@*****.**", "隐心", "使用【隐心抢票助手】报告", s, "", "smtp.163.com", "*****@*****.**", "sendemail"); }); }