//更换头像 public void SEND_CG_REQ_MODIFY_HEAD(uint id) { ModifyHead ip = new Msg.ModifyHead(); ip.Id = id; MemoryStream ms = GetStream(); ModifyHead.Serialize(ms, ip); Send(MsgId.ID_ModifyHead, ms); }
private static void Main(string[] args) { XTrace.UseConsole(true, true); XTrace.WriteLine("浏览器操作"); int p = XmlConfig <SeleniumConfig> .Current.PiHao; //string ph = DataFile.WtingRead("请输入配置文件 ", "输入的配置路径:", (string path) => (path.IndexOf(".config") == -1 ? false : XmlConfig<SeleniumConfig>.Current.Load(path))); string ph = @"Config\Selenium.config"; XTrace.WriteLine($"加载的配置地址:" + ph); XmlConfig <SeleniumConfig> .Current.Load(ph); XmlConfig <SeleniumConfig> .Current.ConfigFile = ph; XmlConfig <SeleniumConfig> .Current.Load(ph); XmlConfig <SeleniumConfig> .Current.ConfigFile = ph; XmlConfig <SeleniumConfig> .Current.Load(ph); TaskTool.AddHyDataConneStr(XmlConfig <SeleniumConfig> .Current.HyAccountDb); TaskTool.AddJiQiMaConnStr(XmlConfig <SeleniumConfig> .Current.JiQiMaDb); Program.ClearProcess(); Program.SetConsoleCtrlHandler(Program.cancelHandler, true); ModifyHead.LoadPicFileInfo(XmlConfig <SeleniumConfig> .Current.TouXiang); switch (DataFile.WtingReadInt("任务类型 0=刷活跃 1=快速注册 2=文本账号保存到数据库", "输入的任务类型:")) { case 0: { AutoHuoYueCaoZuo huoyue = new AutoHuoYueCaoZuo(); Program.AutoCaoZuo = huoyue; huoyue.Start(); break; } case 1: { int needCount = DataFile.WtingReadInt("需要注册的数量:", "输入的注册数量:"); AutoQuickReg reg = new AutoQuickReg(); Program.AutoCaoZuo = reg; reg.Start(needCount); break; } case 2: { AutoLoginTask Login = new AutoLoginTask(); Program.AutoCaoZuo = Login; Login.Start(); break; } } DataFile.WatingOut(); }
protected void ZHInitCaoZuo() { if (XmlConfig <SeleniumConfig> .Current.XiuGaiNick) { this.ToGeRenZhongXin(this.HySeleniumMgr.WebDriver); string nick = HelperText.RdMaJia(5, false); this.OneByOneTaskTryErrF(new Func <IWebDriver, string, bool>(this.HySeleniumMgr.XiuGaiNick), this.HySeleniumMgr, nick); } if (XmlConfig <SeleniumConfig> .Current.XiuGaiTouXiang) { this.ToGeRenZhongXin(this.HySeleniumMgr.WebDriver); FileInfo pic = ModifyHead.GetHeadRandomPath(); if (pic != null) { this.OneByOneTaskTryErrF(new Func <IWebDriver, string, bool>(this.HySeleniumMgr.XiuGaiTouXiang), this.HySeleniumMgr, pic.FullName); } } }