public void GetAll() { string resp = string.Empty; nvm.Clear(); nvm["email"] = uid; nvm["password"] = upass; while (resp == string.Empty) { resp = web.PostPage(pricegetremote, nvm, 0, 0); if (resp == string.Empty) { System.Threading.Thread.Sleep(2000); } } ; plist.Clear(); Count = 0; plist = utils.GetTokensBetween(resp, "{PRICETAG}", "{/PRICETAG}"); Count = plist.Count; string buff = string.Empty; if (Count != 0) { for (int i = 0; i < plist.Count; i++) { buff = buff + "{PRICETAG}" + plist[i].ToString( ) + "{/PRICETAG}"; } disk.Write(buff, pricelocal); } else { buff = disk.Read(pricelocal); plist = utils.GetTokensBetween(resp, "{PRICETAG}", "{/PRICETAG}"); Count = plist.Count; } //public string amount; //public string gp; //public string promo; //public string days; //public string paypal; for (int i = 0; i < Count; i++) { pricelist[i].amount = utils.GetStrBetween(plist[i].ToString(), "{AMOUNT}", "{/AMOUNT}"); pricelist[i].gp = utils.GetStrBetween(plist[i].ToString(), "{GP}", "{/GP}"); pricelist[i].promo = utils.GetStrBetween(plist[i].ToString(), "{PROMO}", "{/PROMO}"); pricelist[i].days = utils.GetStrBetween(plist[i].ToString(), "{DAYS}", "{/DAYS}"); pricelist[i].paypal = utils.GetStrBetween(plist[i].ToString(), "{PAYPAL}", "{/PAYPAL}"); pricelist[i].savings = utils.GetStrBetween(plist[i].ToString(), "{SAVE}", "{/SAVE}"); } }
public void RemoveWhiteLists(StringBuilder gatherlist) { string list = gatherlist.ToString(); MyUtils.MyUtils utils = new MyUtils.MyUtils(); ArrayList groupurls = new ArrayList(); if ((list.Length != 0) && (gatherlist != null)) { if (list.Contains("<GGV2.5>")) //version 2.5 signature { groupurls = utils.GetTokensBetween(list, "<GURL>", "</GURL>"); for (int i = 0; i < groupurls.Count; i++) { try { File.Delete(dirgather + "\\" + groupurls[i].ToString( )); } catch (Exception ex) { ; } } } } }
public string GetPaypalCode(string price, string days) { string buff = disk.Read(pricelocal); ArrayList temp = new ArrayList(); string ret = string.Empty; temp = utils.GetTokensBetween(buff, "{PRICETAG}{AMOUNT}" + price + "{/AMOUNT}", "{/PRICETAG}"); for (int i = 0; i < temp.Count; i++) { if (temp[i].ToString().Contains("{DAYS}" + days + "{/DAYS}")) { ret = utils.GetStrBetween(buff, "{PAYPAL}", "{/PAYPAL}"); break; } } return(ret); }
public int LoadGatherList(ref StringBuilder list) { int ngathered = 0; OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "*.txt|*.txt|*.*|*.*"; ofd.InitialDirectory = dirlists; ofd.Title = "Open Gather List"; DialogResult res = ofd.ShowDialog(); try { if (res != DialogResult.Cancel) { string filepath = Path.GetFullPath(ofd.FileName); if (File.Exists(filepath)) { string text = Read(filepath); MyUtils.MyUtils utils = new MyUtils.MyUtils(); ArrayList groupurls = new ArrayList(); ArrayList uidlists = new ArrayList(); if ((text.Substring(0, 8)) == "<GGV2.5>") //version 2.5 signature { groupurls = utils.GetTokensBetween(text, "<GURL>", "</GURL>"); uidlists = utils.GetTokensBetween(text, "</GID>", "</GROUP>"); for (int i = 0; i < groupurls.Count; i++) { Write(uidlists[i].ToString(), dirgather + "\\" + groupurls[i].ToString()); } } ngathered = GetGatherTotal(list); } } else { ngathered = -1; } } catch (Exception ex) { ; } return(ngathered); }
public string Display() { togrpsel = string.Empty; System.Collections.ArrayList alist;// = new System.Collections.ArrayList(); MyUtils.MyUtils utils = new MyUtils.MyUtils(); Gator.GGDisk disk = new Gator.GGDisk(); string buff = disk.Read(disk.filetogrps); alist = utils.GetTokensBetween(buff, "<GURL>", "</GURL>"); for (int i = 0; i < alist.Count; i++) { if (!cboToGroup.Items.Contains(alist[i])) { cboToGroup.Items.Add(alist[i].ToString()); } } if (cboToGroup.Items.Count > 0) { cboToGroup.SelectedIndex = 0; } this.ShowDialog(); return(togrpsel); }
public void GetDetails() { MyWeb.MyWeb myweb = new MyWeb.MyWeb(); MyUtils.MyUtils utils = new MyUtils.MyUtils(); string post = string.Empty; while (post == string.Empty) { post = myweb.GetWebPage(link, 0, 0); if (post == string.Empty) { System.Threading.Thread.Sleep(3000); } else { break; } } string tmp = utils.GetStrBetween(post, "<steamID64>", "</steamID64>"); tmp = tmp.Replace(Environment.NewLine, string.Empty); if (tmp != string.Empty) { id = tmp; } tmp = utils.GetStrBetween(post, "<customURL>", "</customURL>"); tmp = utils.GetStrBetween(tmp, "<", ">"); int beg, end; beg = end = -1; if (tmp != string.Empty) { beg = tmp.LastIndexOf("["); end = tmp.IndexOf("]"); if ((beg != -1) && (end != -1) && ((end - beg) >= 0)) { url = tmp.Substring(beg + 1, end - beg - 1); } } tmp = utils.GetStrBetween(post, "<steamID>", "</steamID>"); tmp = utils.GetStrBetween(tmp, "<", ">"); beg = end = -1; if (tmp != string.Empty) { beg = tmp.LastIndexOf("["); end = tmp.IndexOf("]"); if ((beg != -1) && (end != -1) && ((end - beg) >= 0)) { name = tmp.Substring(beg + 1, end - beg - 1); } } groups.Clear(); groups = utils.GetTokensBetween(post, "<groupID64>" + Environment.NewLine, Environment.NewLine + "</groupID64>"); if (groups.Count == 0) { groups = utils.GetTokensBetween(post, "<groupID64>", "</groupID64>"); } ArrayList arrltmp = new ArrayList(); arrltmp.Clear(); for (int i = 0; i < groups.Count; i++) { Group grp = new Group(groups[i].ToString(), Constants.GroupInitType.groupid); arrltmp.Add(grp.url); //string strcnt = grp.total.ToString(); } groups.Clear(); groups = arrltmp; }