private bool OneReg() { bool flag; base.GeRegJqm(); FiddlerHandle.AutoWeb.HySeleniumWeiBoRegMgr hySeleniumWeiBoRegMgr = new FiddlerHandle.AutoWeb.HySeleniumWeiBoRegMgr(); FiddlerHandle.AutoWeb.HySeleniumWeiBoRegMgr hySeleniumWeiBoRegMgr1 = hySeleniumWeiBoRegMgr; this.HySeleniumWeiBoRegMgr = hySeleniumWeiBoRegMgr; base.HySeleniumMgr = hySeleniumWeiBoRegMgr1; MobileMgr mobileMgr = new MobileMgr(this.ptType); MobileModel mobileModel = mobileMgr.GetMobilenum(null); base.SetPhoneCodeCallBack(mobileMgr, mobileModel); base.HySeleniumMgr.ClearCach(mobileModel.PhoneNumber); string password = base.CratePasswor(); bool ret = this.HySeleniumWeiBoRegMgr.WeiBoRegHy("", password, mobileModel.PhoneNumber, mobileModel.CountryCode); if (ret) { HyAccount zh = new HyAccount() { UserName = mobileModel.PhoneNumber, UserPass = password, PiHao = XmlConfig <SeleniumConfig> .Current.PiHao, Enable = true, RegType = RegType.Weibo, BeiZhu = "谷歌浏览器自动化操作微博注册" }; zh.SaveModel(mobileModel); DateTime now = TimerX.Now; zh.CreateTime = now; string jqmStr = (string)SelementHelper.ExecJs(base.HySeleniumMgr.WebDriver, "return hyDecode(getCommmonInfo());", Array.Empty <object>()); zh.JiQiMa = jqmStr; zh.UpdateTime = now.AddDays(-1); zh.Save(); flag = ret; } else { XTrace.WriteLine("注册失败"); flag = false; } return(flag); }
public static string GetJqmStr(IWebDriver webDriver, params object[] args) { string str; try { webDriver.SwitchTo().DefaultContent(); Thread.Sleep(1000); SelementHelper.ExecJs(webDriver, Resources.hydevice_8290851_Get, Array.Empty <object>()); str = (string)SelementHelper.ExecJs(webDriver, "return getCommmonInfo2();", Array.Empty <object>()); return(str); } catch (Exception exception) { Exception ex = exception; XTrace.WriteLine(string.Concat("执行脚本获取机器码信息出错 ", ex.Message, " 有可能时脚本还没初始化,执行流程不要太快")); } str = null; return(str); }