using System; using System.Collections.Generic; using System.Threading; using AllBase; using Work.ManageClass; using System.Threading.Tasks; namespace Work.Api { public class GetShopLoginInfo { public string Name; public GetShopLoginInfo(string name) { Name = name; } public static List ShopCat = new List(); public static List ShopCatTemp = new List(); public static List Shops = new List(); public static List ShopBak = new List(); public static List ShopTemp = new List(); private Dictionary GetCookies(ShopInfo SpIn) { int AgainCount = 0; Dictionary dicCookie = new Dictionary(); string NewUrl = BaseClass.BuildObjString("pdd_shop_tempx&act=get_shop_cookies_list"); Again: string Newhtml = GetHtml.PostUtf8(NewUrl, UserLogin.GetSignaturex("", "") + "&shops=" + GetHtml.UrlEncodeUtf8(Newtonsoft.Json.JsonConvert.SerializeObject(SpIn))); if (string.IsNullOrEmpty(Newhtml) || Newhtml.Contains("Error No File")) { if (AgainCount < 2) { AgainCount++; Thread.Sleep(50); goto Again; } } var m = BaseRegex.GetMatchRegex(ref Newhtml, @"([\w\W]+?)"); for (int j = 0; m != null && j < m.Count; j++) { string shopName = m[j].Groups[1].Value; string json = m[j].Groups[2].Value; if (!string.IsNullOrEmpty(json) && !json.Contains("{}") && !json.Contains("none") && !json.Contains("noney")) { if (!dicCookie.ContainsKey(shopName)) { dicCookie.Add(shopName, json); } } } return dicCookie; } } }