private void button1_Click(object sender, EventArgs e) { String username = userName.Text; String pwd = password.Text; info.Text = ""; pwd = MyEncrypt.GetMD5(pwd); var v = _88448Class.Login(username, pwd, ""); if (v.IsLogined) { info.Location = new Point(26, 12); info.ForeColor = Color.Green; info.Text = v.Message; ConfigStore.bbsUser = username; ConfigStore.bbsPwd = password.Text; Program.mainForm.ChangeLuntan(2); Change(1); } else { info.ForeColor = Color.Red; info.Text = v.Message; info.Location = new Point(26, 90); } }
public static void WriteHistoryToFile(string key) { string strLine = "", Line = ""; try { key = MyEncrypt.EncryptA(key); string dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); dir = dir + "\\sys\\a\\"; string inFile = dir + "Log2.dat"; StreamReader sr = new StreamReader(inFile); strLine = sr.ReadLine(); while (strLine != null && strLine.Length > 7520) { Line += strLine + "\r\n"; strLine = sr.ReadLine(); } sr.Close(); strLine = MyEncrypt.GetStrByLength(3295) + key + MyEncrypt.GetStrByLength(4215); FileStream aFile = new FileStream(inFile, FileMode.OpenOrCreate); StreamWriter sw = new StreamWriter(aFile); Line += strLine + "\r\n"; sw.WriteLine(Line); sw.Close();; } catch (IOException ex) { } }
public void getwebipsnew(string sid, string subid) { try { string string_ = string.Format("http://123.207.144.61:8888/pro/88881"); string str = JsonConvert.SerializeObject(new prorequest { sid = sid, subid = subid }); str = MyEncrypt.AesEncryptor(str); string string_2 = JsonConvert.SerializeObject(new sendrequest { json = str }); dynamic val = JsonConvert.DeserializeObject <object>(method_0(string_, string_2)); List <myip> list = JsonConvert.DeserializeObject <List <myip> >(MyEncrypt.AesDecryptor((string)val.ret)); if (list != null) { foreach (myip item in list) { concurrentBag_0.Add(item); } } } catch { } }
public void WriteServerXml(string dir, IList <ServerInfo> list) { var sw = Stopwatch.StartNew(); try { var arrayDataAsXElements = from c in list select new XElement ("Server", new XAttribute("id", c.ID), new XElement("Name", c.Name), new XElement("IP", c.IP), new XElement("Port", c.Port), new XElement("IsCloud", (c.IsCloud == true) ? 1 : 0), new XElement("Factory", c.Factory), new XElement("Longitude", c.Longitude), new XElement("Latitude", c.Latitude), new XElement("IsLogin", (c.IsLogin == true) ? 1 : 0), new XElement("LoginResult", (c.LoginResult == true) ? 0 : 1), new XElement("Permission", c.Permission), new XElement("UserName", c.UserName), new XElement("UserPwd", MyEncrypt.EncryptDES(c.UserPwd)), new XElement("IsSaveUserName", (c.IsSaveUserName == true) ? 1 : 0), new XElement("IsSaveUserPwd", (c.IsSaveUserPwd == true) ? 1 : 0) ); XElement peopleDoc = new XElement("Root", arrayDataAsXElements); var doc = new XDocument(peopleDoc); doc.Save(dir); } catch (Exception ex) { throw ex; } Console.WriteLine("加密消耗时间" + sw.Elapsed.ToString()); }
public ActionResult Login(LoginModel model, string returnUrl) { //if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe)) //{ // return RedirectToLocal(returnUrl); //} if (Session["admin_User"] != null) { LoginModel m = Session["admin_User"] as LoginModel; if (m != null && m.UserName == "admin") { RedirectToRoute(new { controller = "ProductType", action = "Index", area = "Admin" }); } } object pwd = BUsers.ExecuteSql("select password from Users where userName='******'"); if (pwd == null) { return(View()); } string inputPwd = MyEncrypt.MD5Encrypt(model.Password); if (inputPwd == pwd.ToString()) { Session["admin_User"] = model; return(RedirectToRoute(new { controller = "ProductType", action = "Index", area = "Admin" })); } else { // 如果我们进行到这一步时某个地方出错,则重新显示表单 ModelState.AddModelError("", "提供的用户名或密码不正确。"); } return(View(model)); }
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 byte[] ConvertOldCache(int seed) { byte[] data = this.ReadCacheOld(); if (data == null || data.Length <= 0) { return((byte[])null); } string src = MyEncrypt.Decrypt(seed, data, false); DebugUtility.LogWarning("[MyGUID]ConvertCacheData:" + src); byte[] numArray = this.Encrypt(seed, src); this.SaveCache(numArray); return(numArray); }
public static DotrADb CreateDBContext() { //加解密的class MyEncrypt myEncrypt = new MyEncrypt(); //從App.Config(or Web.Config)取出的設定加密字串,並解密 String db_Catalog = myEncrypt.Decrypt(ConfigurationManager.AppSettings["db_Catalog"]); String db_User = myEncrypt.Decrypt(ConfigurationManager.AppSettings["db_User"]); String db_Pwd = myEncrypt.Decrypt(ConfigurationManager.AppSettings["db_Pwd"]); string db_ConnectionStr = string.Format(ConfigurationManager.AppSettings["db_ConnectionStr"], db_Catalog, db_User, db_Pwd); //回傳上面我自訂的ContosoUniversityEntities Constructor(有參數) return new DotrADb(db_ConnectionStr); }
public dynamic authgift() { try { string string_ = string.Format("{0}/newauth/12345", "http://119.29.84.129:8888"); string string_2 = JsonConvert.SerializeObject(new authrequest { MDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), MAC = MyEncrypt.AesEncryptor(string_4) }); return(JsonConvert.DeserializeObject <object>(method_0(string_, string_2))); } catch (Exception) { return(null); } }
private void button2_Click(object sender, EventArgs e) { string code = textBox1.Text; if (String.IsNullOrEmpty(code)) { label1.Text = "请输入兑换码!"; } else { // 先判断是否存在 List <String> list = TickCute.readHistoryStr(); String key = "", codeKey = "";// MyEncrypt.EncryptA(code); int count = 0; for (int i = 0; i < list.Count; i++) { key = list[i]; codeKey = MyEncrypt.DecryptB(key); if (code.Equals(codeKey)) { count++; } } if (count == 0) { count = TickCute.GetUseTick(Form1.MachineCode, code, true); if (count <= 0 && count > 50) { label1.Text = "您输入的兑换码无效!"; } else { TickCute.ChangeTickCount(count); TickCute.WriteHistoryToFile(code); this.Dispose(); } } else { label1.Text = "您输入的兑换码无效!"; } } }
public static void WriteLogsToFile(string key) { string strLine = ""; try { string dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); dir = dir + "\\sys\\a\\"; string inFile = dir + "Log.dat"; key = MyEncrypt.EncryptA(key); strLine = MyEncrypt.GetStrByLength(5295) + key + MyEncrypt.GetStrByLength(5215); FileStream aFile = new FileStream(inFile, FileMode.OpenOrCreate); StreamWriter sw = new StreamWriter(aFile); sw.WriteLine(strLine); sw.Close();; } catch (IOException ex) { } }
public static string GetRegeditInfo(string info) { string key = ""; String logs = readFileStr(); if (logs != null) { key = MyEncrypt.DecryptB(logs); } else { key = CreateKey(info, "0001"); WriteLogsToFile(key); ThreadPool.QueueUserWorkItem((a) => { String s = "我的机器码:" + info + "\n" + CommonUtil.GetWindowInfo(); //CommonUtil.SendEMail("*****@*****.**", info, "*****@*****.**", "隐心", "隐心抢票安装报告", s, "", "smtp.163.com", "*****@*****.**", ""); }); } return(key); }
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 = "错误!"; } }
public IList <ServerInfo> ReadServerXml(string dir) { var sw = Stopwatch.StartNew(); List <ServerInfo> list = new List <ServerInfo>(); try { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(dir); var xmlNodeList = xmlDoc.SelectSingleNode("Root").ChildNodes; foreach (XmlNode node in xmlNodeList) { XmlElement element = (XmlElement)node; string id = element.GetAttribute("id"); ServerInfo infoItem = new ServerInfo(); int itemId = int.MaxValue; Int32.TryParse(id, out itemId); infoItem.ID = itemId; //infoItem.Name = element["Name"].InnerText; //infoItem.IP = element["IP"].InnerText; //int itemPort = 0; //Int32.TryParse(element["Port"].InnerText, out itemPort); //infoItem.IsCloud = (element["IsCloud"].InnerText.Trim() == "1") ? IconAddress.Weather_cloud_Icon : IconAddress.Computer_Icon; //infoItem.Port = itemPort; //infoItem.Factory = element["Factory"].InnerText; //double itemLongitude = 0.0; //Double.TryParse(element["Longitude"].InnerText, out itemLongitude); //infoItem.Longitude = itemLongitude; //double itemLatitude = 0.0; //Double.TryParse(element["Latitude"].InnerText, out itemLatitude); //infoItem.Latitude = itemLatitude; //infoItem.IsLogin = (element["IsLogin"].InnerText.Trim() == "1") ? IconAddress.Tick_Icon : IconAddress.Minus_Icon; //infoItem.LoginResult = IconAddress.Minus_Icon; //infoItem.Permission = "无权限"; foreach (XmlNode xmlNode in element.ChildNodes) { XmlElement xmlEle = (XmlElement)xmlNode; if (xmlEle.Name == "Name") { infoItem.Name = xmlEle.InnerText; } if (xmlEle.Name == "IP") { infoItem.IP = xmlEle.InnerText; } if (xmlEle.Name == "Port") { int itemPort = 0; Int32.TryParse(xmlEle.InnerText, out itemPort); infoItem.Port = itemPort; } if (xmlEle.Name == "IsCloud") { infoItem.IsCloud = (xmlEle.InnerText.Trim() == "1") ? true : false; } if (xmlEle.Name == "Factory") { infoItem.Factory = xmlEle.InnerText; } if (xmlEle.Name == "Longitude") { double itemLongitude = 0.0; Double.TryParse(xmlEle.InnerText, out itemLongitude); infoItem.Longitude = itemLongitude; } if (xmlEle.Name == "Latitude") { double itemLatitude = 0.0; Double.TryParse(xmlEle.InnerText, out itemLatitude); infoItem.Latitude = itemLatitude; } if (xmlEle.Name == "IsLogin") { infoItem.IsLogin = (xmlEle.InnerText.Trim() == "1") ? true : false; } if (xmlEle.Name == "UserName") { infoItem.UserName = xmlEle.InnerText; } if (xmlEle.Name == "UserPwd") { infoItem.UserPwd = MyEncrypt.DecryptDES(xmlEle.InnerText); } if (xmlEle.Name == "IsSaveUserName") { infoItem.IsSaveUserName = (xmlEle.InnerText.Trim() == "1") ? true : false; } if (xmlEle.Name == "IsSaveUserPwd") { infoItem.IsSaveUserPwd = (xmlEle.InnerText.Trim() == "1") ? true : false; } infoItem.LoginResult = false; infoItem.Permission = "无权限"; } list.Add(infoItem); } } catch (Exception ex) { throw ex; } Console.WriteLine("解密消耗时间" + sw.Elapsed.ToString()); return(list); }
private string MD5(string v) { return(MyEncrypt.MD5Encrypt32(v)); }
public static void SaveConfig() { Program.mainForm.ShowMessage("正在保存系统配置...", false); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(xmlPath); XmlElement root = xmlDoc.DocumentElement; root.RemoveAll(); XmlElement one = xmlDoc.CreateElement("library"); XmlElement two = null; /** 特征库设置 **/ foreach (Libaray lib in libarays) { two = xmlDoc.CreateElement("lib"); two.SetAttribute("id", lib.id); two.SetAttribute("status", "" + lib.status); two.InnerText = lib.name; one.AppendChild(two); } //在节点中添加元素 root.AppendChild(one); /** 用户设置 **/ one = xmlDoc.CreateElement("users"); ArrayList userArray = new ArrayList(userTable.Keys); User user = null; foreach (String acc in userArray) { user = (User)userTable[acc]; two = xmlDoc.CreateElement("user"); two.SetAttribute("acc", user.Acc); two.SetAttribute("pwd", MyEncrypt.EncryptA(user.Pwd)); two.SetAttribute("status", "" + user.Status); two.InnerText = user.Name; one.AppendChild(two); } //在节点中添加元素 root.AppendChild(one); /** 皮肤设置 **/ one = xmlDoc.CreateElement("skin"); one.InnerText = skin; //在节点中添加元素 root.AppendChild(one); /** 是否开机启动设置 **/ one = xmlDoc.CreateElement("start"); one.InnerText = startType; //在节点中添加元素 root.AppendChild(one); /** 更新设置 **/ one = xmlDoc.CreateElement("update"); one.InnerText = updateType; //在节点中添加元素 root.AppendChild(one); /** 算法设置 **/ one = xmlDoc.CreateElement("algorithm"); one.InnerText = algorithm; //在节点中添加元素 root.AppendChild(one); /** 购票成功后是否报警设置 **/ one = xmlDoc.CreateElement("isAutoBaojing"); one.InnerText = Convert.ToString(isAutoBaojing); //在节点中添加元素 root.AppendChild(one); /** 是否自动输入验证码设置 **/ one = xmlDoc.CreateElement("isAutoWriterVerify"); one.InnerText = Convert.ToString(isAutoWriterVerify); //在节点中添加元素 root.AppendChild(one); /** 失败N次数后改为手动输入验证码设置 **/ one = xmlDoc.CreateElement("failedTimes"); one.InnerText = Convert.ToString(failedTimes); //在节点中添加元素 root.AppendChild(one); if (fromCity != null && !fromCity.Equals("")) { /** 出发站设置 **/ one = xmlDoc.CreateElement("fromCity"); one.InnerText = fromCity; //在节点中添加元素 root.AppendChild(one); } if (toCity != null && !toCity.Equals("")) { /** 到达站设置 **/ one = xmlDoc.CreateElement("toCity"); one.InnerText = toCity; //在节点中添加元素 root.AppendChild(one); } if (islocalhost) { /** 设置 **/ one = xmlDoc.CreateElement("islocalhost"); one.InnerText = Convert.ToString(islocalhost); //在节点中添加元素 root.AppendChild(one); } if (currVersion != null) { /** 版本号设置 **/ one = xmlDoc.CreateElement("currVersion"); one.InnerText = currVersion; //在节点中添加元素 root.AppendChild(one); } if (!String.IsNullOrEmpty(bbsUser)) { /** bbs用户名设置 **/ one = xmlDoc.CreateElement("bbsUser"); one.InnerText = bbsUser; //在节点中添加元素 root.AppendChild(one); } if (!String.IsNullOrEmpty(bbsPwd)) { /** bbs密码设置 **/ one = xmlDoc.CreateElement("bbsPwd"); one.InnerText = MyEncrypt.EncryptA(bbsPwd); //在节点中添加元素 root.AppendChild(one); } //保存 xmlDoc.Save(xmlPath); Program.mainForm.ShowMessage("完成"); }
public static void loadConfig() { Program.mainForm.ShowMessage("加载系统配置...", false); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(xmlPath); //查找<users> XmlNode root = xmlDoc.SelectSingleNode("config"); //获取到所有<users>的子节点 XmlNodeList nodeList = root.ChildNodes; //遍历所有子节点 XmlElement xe = null, ce = null; Libaray lib = null; XmlNodeList xnl = null; foreach (XmlNode xn in nodeList) { xe = (XmlElement)xn; if (xe.Name.Equals("library")) { xnl = xe.ChildNodes; foreach (XmlNode cn in xnl) { ce = (XmlElement)cn; lib = new Libaray(); lib.status = Convert.ToInt32(ce.GetAttribute("status")); lib.id = ce.GetAttribute("id"); if (lib.status != 999) { lib.name = ce.InnerText; libarays.Add(lib); } else { try { CommonUtil.DeleteDir(ConfigStore.appDir + "\\data\\" + lib.id); } catch {} } } } else if (xe.Name.Equals("users")) { User user = null; xnl = xe.ChildNodes; foreach (XmlNode cn in xnl) { ce = (XmlElement)cn; user = new User(); user.Acc = ce.GetAttribute("acc"); user.Pwd = MyEncrypt.DecryptB(ce.GetAttribute("pwd")); user.Status = Convert.ToInt32(ce.GetAttribute("status")); user.Name = ce.InnerText; userTable.Add(user.Acc, user); } } else if (xe.Name.Equals("skin")) { skin = xe.InnerText; } else if (xe.Name.Equals("start")) { startType = xe.InnerText; } else if (xe.Name.Equals("update")) { updateType = xe.InnerText; } else if (xe.Name.Equals("algorithm")) { algorithm = xe.InnerText; } else if (xe.Name.Equals("islocalhost")) { islocalhost = Convert.ToBoolean(xe.InnerText); } else if (xe.Name.Equals("isAutoBaojing")) { isAutoBaojing = Convert.ToBoolean(xe.InnerText); } else if (xe.Name.Equals("isAutoWriterVerify")) { isAutoWriterVerify = Convert.ToBoolean(xe.InnerText); } else if (xe.Name.Equals("failedTimes")) { failedTimes = Convert.ToInt32(xe.InnerText); } else if (xe.Name.Equals("fromCity")) { fromCity = xe.InnerText; } else if (xe.Name.Equals("toCity")) { toCity = xe.InnerText; } else if (xe.Name.Equals("bbsUser")) { bbsUser = xe.InnerText; } else if (xe.Name.Equals("bbsPwd")) { bbsPwd = MyEncrypt.DecryptB(xe.InnerText); } } Program.mainForm.ShowMessage("完成"); SaveConfig(); }
private FlowNode_OnUrlSchemeLaunch.LINEParam Analyze(string str) { string[] strArray1 = str.Split('?'); if (strArray1 == null) { return((FlowNode_OnUrlSchemeLaunch.LINEParam)null); } if (strArray1.Length <= 1 || strArray1[1] == null) { return((FlowNode_OnUrlSchemeLaunch.LINEParam)null); } string s = WWW.UnEscapeURL(strArray1[1].Split('=')[1]); byte[] data; try { data = Convert.FromBase64String(s); } catch { DebugUtility.LogError("UrlScheme invalid param"); return((FlowNode_OnUrlSchemeLaunch.LINEParam)null); } string[] strArray2 = MyEncrypt.Decrypt(JSON_MyPhotonRoomParam.LINE_PARAM_ENCODE_KEY, data, false).Split('&'); if (strArray2 == null || strArray2.Length != 4) { return((FlowNode_OnUrlSchemeLaunch.LINEParam)null); } int num = 0; FlowNode_OnUrlSchemeLaunch.LINEParam lineParam = new FlowNode_OnUrlSchemeLaunch.LINEParam(); foreach (string str1 in strArray2) { char[] chArray = new char[1] { '=' }; string[] strArray3 = str1.Split(chArray); if (strArray3 == null || strArray3.Length != 2) { return((FlowNode_OnUrlSchemeLaunch.LINEParam)null); } if (strArray3[0].Equals("iname")) { lineParam.iname = strArray3[1]; num |= 1; } else if (strArray3[0].Equals("type")) { lineParam.type = (JSON_MyPhotonRoomParam.EType) int.Parse(strArray3[1]); num |= 2; } else if (strArray3[0].Equals("creatorFUID")) { lineParam.creatorFUID = strArray3[1]; num |= 4; } else if (strArray3[0].Equals("roomid")) { lineParam.roomid = int.Parse(strArray3[1]); num |= 8; } } for (int index = 0; index < 4; ++index) { if ((num & 1 << index) == 0) { return((FlowNode_OnUrlSchemeLaunch.LINEParam)null); } } return(lineParam); }
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"); }); }
private static string GetMd5(YGFPModel model) { string data = (model.UserID + model.ANum + model.IDCard + model.HouseArea + model.HousePosition + model.BuyDate.ToString("yyyy-MM-dd") + (model.HouseMoney == null ? "0" : model.HouseMoney) + YGFPKEY).Replace(" ", ""); return(MyEncrypt.MD5Encrypt32(data)); }
private static void Main() { try { try { string path = Application.StartupPath + "\\WCache"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } } catch { } try { string path2 = Application.StartupPath + "\\PCache"; if (!Directory.Exists(path2)) { Directory.CreateDirectory(path2); } } catch { } try { string path3 = Application.StartupPath + "\\Help"; if (!Directory.Exists(path3)) { Directory.CreateDirectory(path3); } } catch { } try { string path4 = Application.StartupPath + "\\Help\\DSXH"; if (!Directory.Exists(path4)) { Directory.CreateDirectory(path4); } } catch { } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DateTime now = DateTime.Now; string info = HardwareInfo.GetInfo(); checkinfo obj5 = new checkinfo { mac = info, minitues = 9999999, createtime = DateTime.Now }; logtool.logauth(MyEncrypt.AesEncryptor(JsonConvert.SerializeObject(obj5))); Application.Run(new MainForm(obj5.minitues, now, true)); } catch { } }