/// <summary> /// 打开指定平台一个页面 /// </summary> /// <param name="platform"></param> private void OpenTabPlatformMenuToolStrip(SupportPlatformEnum platform) { var siteObj = GlobalContext.SupportPlatforms.Find(x => x.Platform == platform); if (null == siteObj) { string platformDescription = platform.GetEnumDescription(); MessageBox.Show($"未能正确从配置文件加载平台地址:{platformDescription ?? platform.ToString()}"); return; } this.NewTab(siteObj.SiteUrl); }
/// <summary> /// 拉取发送cookie到redis /// </summary> /// <param name="platform"></param> /// <param name="cookies"></param> public static List <CefCookie> PullFromRedisCookies(SupportPlatformEnum platform) { var siteObj = GlobalContext.SupportPlatforms.Find(x => x.Platform == platform); if (null == siteObj) { string platformDescription = platform.GetEnumDescription(); string errMsg = string.Format($"CrawlerCookiesPopJob,未能正确从配置文件加载平台地址:{platformDescription ?? platform.ToString()}"); throw new Exception(errMsg); } //键 return(PullFromRedisCookies(siteObj.SiteUrl)); }