public string GetSessionID(string buff) { string ret = string.Empty; MyUtils.MyUtils utils = new MyUtils.MyUtils(); ret = utils.GetStrBetween(buff, "sessionid=", ";"); if (ret == string.Empty) { ret = utils.GetStrBetween(buff, "sessionid=", ","); } //int beg, end; //beg = end = -1; //if ((cookie != string.Empty) && (cookie != null)) // { // beg = cookie.IndexOf("sessionid="); // if (beg != -1) // { // beg += 10; // end = cookie.IndexOfAny(new char[] { ';', ',' }, beg); // if (end == -1) // ret = cookie.Substring(beg); // else // ret = cookie.Substring(beg, end - beg); // } // } return(ret); }
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 UpdateGlobalInviteCount(int icur) { string resp = string.Empty; string ret = string.Empty; NameValueCollection nvm = new NameValueCollection( ); nvm.Clear( ); nvm["iadd"] = icur.ToString( ); MyWeb.MyWeb web = new MyWeb.MyWeb(); while (resp == string.Empty) { resp = web.PostPage(urlglobal, nvm, 0, 0); if (resp == string.Empty) { System.Threading.Thread.Sleep(2000); } else { break; } } MyUtils.MyUtils utils = new MyUtils.MyUtils( ); ret = utils.GetStrBetween(resp, "{TOTAL}", "{/TOTAL}"); return(ret); }
public void GetRSAKey(string name) { uname = name; NameValueCollection formData = new NameValueCollection(); formData["username"] = uname; MyWeb.MyWeb web = new MyWeb.MyWeb(); MyUtils.MyUtils utils = new MyUtils.MyUtils(); string resp = string.Empty; while ((resp == string.Empty) || (resp.Contains("Error 503 Service Unavailable")) || (resp.Contains("The Steam Community is currently unavailable"))) { resp = web.PostPage("https://steamcommunity.com/login/getrsakey/", formData, 0, 0, ref cookie); if ((resp == string.Empty) || (resp.Contains("Error 503 Service Unavailable")) || (resp.Contains("The Steam Community is currently unavailable"))) { System.Threading.Thread.Sleep(3000); } } ; string sessid = GetSessionID(resp); if (sessid != string.Empty) { sessionid = sessid; } if (sessionid != string.Empty) { cookie = "sessionid=" + sessionid + ";"; } kmod = utils.GetStrBetween(resp, "\"publickey_mod\":\"", "\""); kexp = utils.GetStrBetween(resp, "\"publickey_exp\":\"", "\""); krsatime = utils.GetStrBetween(resp, "\"timestamp\":\"", "\""); }
public void GetAdminStats(ref string paid, ref string free, ref string totalinvites) { MyWeb.MyWeb web = new MyWeb.MyWeb(); string resp = string.Empty; resp = web.GetWebPage(urlactiveusers, 0, 0); MyUtils.MyUtils utils = new MyUtils.MyUtils(); string ret = utils.GetStrBetween(resp, "<h3>Active users: ", "</h3>"); ret = ret.Replace(" ", string.Empty); if ((ret == string.Empty) || (ret == " ")) { ret = "0"; } paid = ret; ret = utils.GetStrBetween(resp, "<h3>Active free users: ", "</h3>"); ret = ret.Replace(" ", string.Empty); if ((ret == string.Empty) || (ret == " ")) { ret = "0"; } free = ret; ret = utils.GetStrBetween(resp, "<h3>Global Invites Sent: ", "</h3>"); ret = ret.Replace(" ", string.Empty); if ((ret == string.Empty) || (ret == " ")) { ret = "0"; } totalinvites = ret; }
public int GetGatorPointsUsed(string ggemail) { int ret = 0; NameValueCollection nvm = new NameValueCollection( ); nvm.Clear( ); nvm["email"] = ggemail; MyWeb.MyWeb web = new MyWeb.MyWeb( ); string resp = string.Empty; while (resp == string.Empty) { resp = web.PostPage(urlggptsqry, nvm, 0, 0); if (resp == string.Empty) { System.Threading.Thread.Sleep(2000); } } MyUtils.MyUtils utils = new MyUtils.MyUtils(); string tmp = utils.GetStrBetween(resp, "{USED}", "{/USED}"); try { ret = Convert.ToInt32(tmp); } catch (Exception ex) { ret = 0; } ret *= 10; return(ret); }
public Constants.ServerResponse GetTimeRemaining(string email, ref string tremain) { Constants.ServerResponse ret = Constants.ServerResponse.Failed; tremain = "0"; NameValueCollection nvm = new NameValueCollection(); nvm.Clear(); nvm["email"] = email; MyWeb.MyWeb web = new MyWeb.MyWeb(); string resp = string.Empty; while (resp == string.Empty) { resp = web.PostPage(urlgettime, nvm, 0, 0); if (resp == string.Empty) { System.Threading.Thread.Sleep(2000); } } if (resp.Contains("agettime:fail")) { ret = Constants.ServerResponse.Failed; } else if (resp.Contains("agettime:succss")) { ret = Constants.ServerResponse.Success; MyUtils.MyUtils utils = new MyUtils.MyUtils(); tremain = utils.GetStrBetween(resp, "rem{", "}"); tremain = tremain.Replace(",", string.Empty); } return(ret); }
private void DonateClicked(Constants.DonateType dtype, bool ispaypal) { Gator25.PayPalWindow paypal = new Gator25.PayPalWindow(); if (ispaypal == true) { string pcode = string.Empty; if (cboPaypalRates1.SelectedIndex != -1) { string tmp = cboPaypalRates1.SelectedItem.ToString(); MyUtils.MyUtils utils = new MyUtils.MyUtils(); //$100.00 OR 1000 Points = 400 Days (75% Savings!) string amnt = utils.GetStrBetween(tmp, "$", " "); string days = utils.GetStrBetween(tmp, " = ", " "); pcode = price.GetPaypalCode(amnt, days); paypal.DisplayPaypal(pcode); } } else { paypal.DisplayGoogle(dtype); } //string reqfile = string.Empty; //GGDisk disk = new GGDisk(); //switch (dtype) // { // case Constants.DonateType.Donate1: // reqfile = disk.filedonator1; // break; // case Constants.DonateType.Donate2: // reqfile = disk.filedonator2; // break; // case Constants.DonateType.Donate3: // reqfile = disk.filedonator3; // break; // case Constants.DonateType.Donate4: // reqfile = disk.filedonator4; // break; // case Constants.DonateType.Donate5: // reqfile = disk.filedonator5; // break; // case Constants.DonateType.Donate6: // reqfile = disk.filedonator6; // break; // } //if (File.Exists(reqfile)) // { // try // { // System.Diagnostics.Process.Start(reqfile); // } // catch (Exception ex) // { // Log("Exception in donate : " + ex.Message.ToString(), Constants.LogMsgType.Error, true); // } // } }
public void GetDetailsMinimal( ) { 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( ); //groupurls.Clear( ); }
private void frmAds_Load(object sender, EventArgs e) { //////disk = new Gator.GGDisk(); web = new MyWeb.MyWeb(); utils = new MyUtils.MyUtils(); disk = new Gator.GGDisk(); curpage = 0; ads = new AdAPI(ggemail); AdListRefresh(); }
private void frmAds_Load(object sender, EventArgs e) { //////disk = new Gator.GGDisk(); web = new MyWeb.MyWeb(); utils = new MyUtils.MyUtils(); disk = new Gator.GGDisk(); curpage = 0; ads = new AdAPI(ggemail); bgwAds.RunWorkerAsync( ); }
public void WritePlayerGroupStats(Profile profile) { string buff = string.Empty; buff = Read(filetogrps); string toadd = string.Empty; string strbeg = string.Empty; string strcur = string.Empty; for (int i = 0; i < profile.player.groups.Count; i++) { //string chk = "<GID>" + profile.player.groups[i].ToString() + "</GID>"; string chk = "<GURL>" + profile.player.groups[i].ToString() + "</GURL>"; if (buff.Contains(chk)) { MyUtils.MyUtils utils = new MyUtils.MyUtils(); string replace = utils.GetStrBetween(buff, chk, "</NCUR>"); if (replace != string.Empty) { replace = chk + replace + "</NCUR>"; strbeg = utils.GetStrBetween(replace, "<NBEG>", "</NBEG>"); //strcur = utils.GetStrBetween(replace, "<NCUR>", "</NCUR>"); //Group grp = new Group(profile.player.groups[i].ToString(), Constants.GroupInitType.groupid); Group grp = new Group(profile.player.groups[i].ToString(), Constants.GroupInitType.groupurl); strcur = grp.total.ToString(); if ((grp.url != string.Empty) && (grp.url != "")) { toadd = chk + "<GURL>" + grp.url + "</GURL>"; toadd = toadd + "<NBEG>" + strbeg + "</NBEG>"; toadd = toadd + "<NCUR>" + strcur + "</NCUR>"; buff = buff.Replace(replace, toadd); } } } else { //Group grp = new Group(profile.player.groups[i].ToString(), Constants.GroupInitType.groupid); Group grp = new Group(profile.player.groups[i].ToString(), Constants.GroupInitType.groupurl); strcur = grp.total.ToString(); strcur = strcur.Replace(",", string.Empty); strbeg = strcur; if ((grp.url != string.Empty) && (grp.url != "")) { toadd = chk + "<GURL>" + grp.url + "</GURL>"; toadd = toadd + "<NBEG>" + strbeg + "</NBEG>"; toadd = toadd + "<NCUR>" + strcur + "</NCUR>"; buff = buff + toadd; } } System.Threading.Thread.Sleep(500); } Write(buff, filetogrps); }
public string GetActiveUsersCount() { MyWeb.MyWeb web = new MyWeb.MyWeb(); string resp = string.Empty; resp = web.GetWebPage(urlactiveusers, 0, 0); MyUtils.MyUtils utils = new MyUtils.MyUtils(); string ret = utils.GetStrBetween(resp, "<h3>Active users: ", "</h3>"); ret = ret.Replace(" ", string.Empty); return(ret); }
public ServerData CheckUsage() { //uniqueid //#IREM#1000#/IREM##GREM#1000#/GREM##TREM#0#/TREM#GroupGatorv2.5 NameValueCollection nvm = new NameValueCollection(); nvm.Clear(); nvm["uniqueid"] = mid; MyWeb.MyWeb web = new MyWeb.MyWeb(); string resp = string.Empty; while (!resp.Contains("GroupGatorv2.5")) { resp = web.PostPage(urlchkusg, nvm, 0, 0); if (!resp.Contains("GroupGatorv2.5")) { System.Threading.Thread.Sleep(2000); } } MyUtils.MyUtils utils = new MyUtils.MyUtils(); string i = utils.GetStrBetween(resp, "#IREM#", "#/IREM#"); string g = utils.GetStrBetween(resp, "#GREM#", "#/GREM#"); string t = utils.GetStrBetween(resp, "#TREM#", "#/TREM#"); ServerData sdata = new ServerData(); try { sdata.iremain = Convert.ToInt32(i); } catch (Exception ex) { sdata.iremain = 0; } try { sdata.gremain = Convert.ToInt32(g); } catch (Exception ex) { sdata.gremain = 0; } try { sdata.tremain = Convert.ToInt32(t); } catch (Exception ex) { sdata.tremain = 0; } return(sdata); }
public Price(string adminname, string adminpass) { disk = new GGDisk(); web = new MyWeb.MyWeb(); utils = new MyUtils.MyUtils(); nvm = new NameValueCollection(); plist = new ArrayList(); pricelocal = disk.dirconfig + "\\pricelist"; pricegetremote = "http://www.groupgatorcommunity.net/GroupGator/2.5/getprice.php"; pricesetremote = "http://www.groupgatorcommunity.net/GroupGator/2.5/setprice.php"; uid = adminname; upass = adminpass; Count = 0; GetAll(); }
public string GetLastInvitee(StringBuilder list) { string ret = "-1"; MyUtils.MyUtils utils = new MyUtils.MyUtils(); string tmp = string.Empty; int beg = -1; beg = list.ToString().LastIndexOf("<LASTINV>"); if (beg != -1) { tmp = list.ToString().Substring(beg); ret = utils.GetStrBetween(tmp, "<LASTINV>", "</LASTINV>"); } 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 void ChangeGroupBeginCount(string gurl, string newcount) { string chk = "<GURL>" + gurl + "</GURL>"; string buff = Read(filetogrps); if (buff.Contains(chk)) { MyUtils.MyUtils utils = new MyUtils.MyUtils(); string replace = utils.GetStrBetween(buff, chk, "</NBEG>"); if (replace != string.Empty) { replace = chk + replace + "</NBEG>"; string toadd = chk + "<NBEG>" + newcount + "</NBEG>"; buff = buff.Replace(replace, toadd); Write(buff, filetogrps); } } }
public bool IsObsolete(string cver) { string updfile = string.Empty; MyUtils.MyUtils util = new MyUtils.MyUtils(); MyWeb.MyWeb myweb = new MyWeb.MyWeb(); WebService wserv = new WebService(); while (updfile == string.Empty) { updfile = myweb.GetWebPage(wserv.urlupdchk, 0, 0); System.Threading.Thread.Sleep(3000); } string over = util.GetStrBetween(updfile, "<OVER>", "</OVER>"); cver = cver.Replace(".", string.Empty); over = over.Replace(".", string.Empty); int icver = 0; int iover = 0; try { icver = Convert.ToInt32(cver); iover = Convert.ToInt32(over); } catch (Exception ex) { icver = 0; iover = 0; } if (icver <= iover) { return(true); } else { return(false); } }
public AdAPI(string ggemail) { wsrv = new Gator.WebService(); fp = new Gator.FingerPrint(); web = new MyWeb.MyWeb(); utils = new MyUtils.MyUtils(); disk = new Gator.GGDisk(); string id_md5 = string.Empty; id_md5 = fp.CreateMD5Hash(ggemail); if (id_md5.Length > 32) { id_md5 = id_md5.Substring(0, 32); } subid = id_md5; myip = wsrv.GetMyIp(); web.DownloadFile("http://adscendmedia.com/creat/default.gif", disk.filedefcreat, 3, 2000); //curpage = 1; }
public void ReadPlayerGroupStats(string gurl, ref string beg, ref string cur) { string buff = Read(filetogrps); beg = "0"; cur = "0"; if (buff.Contains("<GURL>" + gurl + "</GURL>")) { MyUtils.MyUtils utils = new MyUtils.MyUtils(); string block = string.Empty; block = utils.GetStrBetween(buff, "<GURL>" + gurl + "</GURL>", "</NCUR>"); if (block != string.Empty) { block = block + "</NCUR>"; beg = utils.GetStrBetween(block, "<NBEG>", "</NBEG>"); cur = utils.GetStrBetween(block, "<NCUR>", "</NCUR>"); } } }
public string GetMyIp() { MyWeb.MyWeb web = new MyWeb.MyWeb(); NameValueCollection nvm = new NameValueCollection(); nvm.Clear(); nvm["uniqueid"] = mid; string post = web.PostPage(urlmyip, nvm, 3, 3000); string ret = string.Empty; if (post.Contains("{user_ip:fail}")) { ret = string.Empty; } else { MyUtils.MyUtils utils = new MyUtils.MyUtils(); ret = utils.GetStrBetween(post, "{user_ip:", "}"); } return(ret); }
public int GetGatherTotal(StringBuilder list) { int ret = 0; string tmp = string.Empty; string val = string.Empty; int beg = list.ToString().LastIndexOf("<NTOTAL>"); if (beg != -1) { tmp = list.ToString().Substring(beg); MyUtils.MyUtils utils = new MyUtils.MyUtils(); val = utils.GetStrBetween(tmp, "<NTOTAL>", "</NTOTAL>"); try { ret = Convert.ToInt32(val); } catch (Exception ex) { ret = 0; } } return(ret); }
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 LoadConfig() { GGDisk disk = new GGDisk(); MyUtils.MyUtils utils = new MyUtils.MyUtils(); string buff = disk.Read(disk.filecfg); string stridelay = string.Empty; string strfdelay = string.Empty; string strmiph = string.Empty; if (buff.Length != 0) { string invitedelay = string.Empty; string invitefaildelay = string.Empty; string gatherpref = string.Empty; uname = utils.GetStrBetween(buff, "<STNAME>", "</STNAME>"); upass = utils.GetStrBetween(buff, "<STPASS>", "</STPASS>"); gatherpref = utils.GetStrBetween(buff, "<GPREF>", "</GPREF>"); stridelay = utils.GetStrBetween(buff, "<IWAIT>", "</IWAIT>"); strfdelay = utils.GetStrBetween(buff, "<FWAIT>", "</FWAIT>"); string tmp = utils.GetStrBetween(buff, "<RNDFAILON>", "</RNDFAILON>"); if (tmp == "0") { israndomdelayon = false; } else { israndomdelayon = true; } strmiph = utils.GetStrBetween(buff, "<MIPH>", "</MIPH>"); gatoremail = utils.GetStrBetween(buff, "<GGNAME>", "</GGNAME>"); gatorpass = utils.GetStrBetween(buff, "<GGPASS>", "</GGPASS>"); sessid = utils.GetStrBetween(buff, "<SESSID>", "</SESSID>"); string nti = utils.GetStrBetween(buff, "<INVTOTAL>", "</INVTOTAL>");; string ntbl = utils.GetStrBetween(buff, "<BLTOTAL>", "</BLTOTAL>");; try { ntotalblacklist = Convert.ToInt32(ntbl); ntotalinvite = Convert.ToInt32(nti); } catch (Exception ex) { ntotalinvite = 0; ntotalblacklist = 0; } if (gatherpref == string.Empty) { gatherpref = "6"; } try { gpref = Convert.ToInt32(gatherpref); } catch (Exception ex) { gpref = 6; } try { miph = Convert.ToInt32(strmiph); } catch (Exception ex) { miph = 100; } try { idelay = Convert.ToInt32(stridelay); } catch (Exception ex) { idelay = 18; } try { fdelay = Convert.ToInt32(strfdelay); } catch (Exception ex) { fdelay = 0; } } }
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; }
private void PluginWindow_Load(object sender, EventArgs e) { this.Text = capt; //label1.Text = capt; //"<GGID>" + txtDBName.Text + "</GGID><GGPASS>" + txtDBPass.Text + "</GGPASS>"; //towrite = towrite + "<LIC>PAID</LIC>"; //disk.Write(towrite, disk.filedbdetails); GGDisk disk = new GGDisk(); MyUtils.MyUtils utils = new MyUtils.MyUtils(); string buff = disk.Read(disk.filedbdetails); usr = utils.GetStrBetween(buff, "<GGID>", "</GGID>"); pass = utils.GetStrBetween(buff, "<GGPASS>", "</GGPASS>"); if (buff.Contains("<LIC>DEMO</LIC>")) { lic = Constants.SoftLicense.Demo; usr = "******"; } else { FingerPrint fp = new FingerPrint(); string mid = fp.GetComuputerID(); WebService serv = new WebService(); WebService.ServerData sdata = new WebService.ServerData(); sdata.email = usr; sdata.pass = pass; sdata.hid = mid; sdata.lockcomp = "false"; Constants.ServerResponse resp = serv.Login(sdata); lic = Constants.SoftLicense.Demo; if (resp == Constants.ServerResponse.Valid) { lic = Constants.SoftLicense.Paid; } else { lic = Constants.SoftLicense.Demo; } } if (lic == Constants.SoftLicense.Demo) { lblUserMail1.Text = "*****@*****.**"; } else { lblUserMail1.Text = usr; } ThreadStart tsSK = new ThreadStart(SideKick); Thread tSK = new Thread(tsSK); tSK.IsBackground = true; tSK.Start( ); }
public Constants.AvailableUpdate IsUpdateAvailable(ref string loc) { string updfile = string.Empty; MyUtils.MyUtils util = new MyUtils.MyUtils(); MyWeb.MyWeb myweb = new MyWeb.MyWeb(); WebService wserv = new WebService(); while (updfile == string.Empty) { updfile = myweb.GetWebPage(wserv.urlupdchk, 0, 0); System.Threading.Thread.Sleep(3000); } lcv = util.GetStrBetween(updfile, "<TYPEC>", "</TYPEC>"); lcf = util.GetStrBetween(updfile, "<CFILE>", "</CFILE>"); lncv = util.GetStrBetween(updfile, "<TYPENC>", "</TYPENC>"); lncf = util.GetStrBetween(updfile, "<NCFILE>", "</NCFILE>"); cv = cv.Replace(".", string.Empty); lncv = lncv.Replace(".", string.Empty); lcv = lcv.Replace(".", string.Empty); int icv = 0; int ilncv = 0; int ilcv = 0; try { icv = Convert.ToInt32(cv); ilncv = Convert.ToInt32(lncv); ilcv = Convert.ToInt32(lcv); } catch (Exception ex) { icv = 0; ilncv = 0; ilcv = 0; } Constants.AvailableUpdate ret = Constants.AvailableUpdate.NoUpdate; if (icv > ilcv) { ret = Constants.AvailableUpdate.NoUpdate; if (ilncv > icv) { ret = Constants.AvailableUpdate.NonCritical; loc = lncf; } } else if (icv == ilcv) { if (ilncv > icv) { loc = lncf; ret = Constants.AvailableUpdate.NonCritical; } } else if (icv < ilcv) { ret = Constants.AvailableUpdate.Critical; if (ilncv >= ilcv) { loc = lncf; } else { loc = lcf; } } return(ret); }
private void AuthProc() { gt.lblLoginStatus.Text = "AUTHENTICATING"; gt.lblLoginStatus.Refresh(); NameValueCollection formData = new NameValueCollection(); formData.Clear(); formData["username"] = uname; formData["password"] = encpwd; formData["emailauth"] = emailauth; formData["captchagid"] = captchaid; formData["captcha_text"] = captchatxt; formData["emailsteamid"] = emailsteamid; formData["rsatimestamp"] = krsatime; MyWeb.MyWeb web = new MyWeb.MyWeb(); string resp = string.Empty; while ((resp == string.Empty) || (resp.Contains("Error 503 Service Unavailable")) || (resp.Contains("The Steam Community is currently unavailable"))) { resp = web.PostPage("https://steamcommunity.com/login/dologin/", formData, 0, 0, ref cookie); if ((resp == string.Empty) || (resp.Contains("Error 503 Service Unavailable")) || (resp.Contains("The Steam Community is currently unavailable"))) { System.Threading.Thread.Sleep(3000); } } ; string sessid = GetSessionID(resp); if (sessid != string.Empty) { sessionid = sessid; } if (sessionid != string.Empty) { cookie = "sessionid=" + sessionid + ";"; } //sessionid=NTY4MjAzNjI3; Steam_Language=english; timezoneOffset=19800,0; steamLogin=76561198060247951%7C%7CB758FED3E08631A1A8468DCD27508C49E0CA4EBD MyUtils.MyUtils utils = new MyUtils.MyUtils(); if (resp.Contains("\"message\":\"Incorrect login\"")) { status = Constants.SignInStatus.Failed; } if (resp.Contains("login_complete\":true")) { //{"success":true,"login_complete":true,"transfer_url":"https:\/\/store.steampowered.com\/\/login\/transfer","transfer_parameters":{"steamid":"76561198060247951","token":"4A932916A0F2FC5D1E14EC141545E5758153BFD6"}} /////// // Cache-Control: no-cache //Pragma: no-cache //Set-Cookie: steamLogin=76561198060247951%7C%7CB758FED3E08631A1A8468DCD27508C49E0CA4EBD; path=/ //Set-Cookie: steamMachineAuth76561198060247951=DB9DA53AC036A06AC4D80E5409DADB21088D3991; expires=Fri, 15-Jul-2022 18:12:35 GMT; path=/; secure; httponly //Content-Length: 267 //Connection: close //Content-Type: application/json; charset=utf-8 //{"success":true,"login_complete":true,"transfer_url":"https:\/\/store.steampowered.com\/\/login\/transfer","transfer_parameters":{"steamid":"76561198060247951","token":"B758FED3E08631A1A8468DCD27508C49E0CA4EBD","webcookie":"DB9DA53AC036A06AC4D80E5409DADB21088D3991"}} // //////// transurl = utils.GetStrBetween(resp, "\"transfer_url\":\"", "\""); transurl = transurl.Replace("\\", string.Empty); steamid = utils.GetStrBetween(resp, "steamid\":\"", "\""); token = utils.GetStrBetween(resp, "token\":\"", "\""); webcookie = utils.GetStrBetween(resp, "webcookie\":\"", "\""); steamlogin = steamid + "%7C%7c" + token; //string tmpckie = string.Empty; if (sessionid == string.Empty) { //web.GetWebPage("http://steamcommunity.com/profiles/" + steamid + "/?xml=1", 3, 5000, ref tmpckie); resp = web.GetWebPage("http://steamcommunity.com/profiles/" + steamid + "/?xml=1", 3, 5000); sessid = string.Empty; sessid = GetSessionID(resp); if (sessid != string.Empty) { sessionid = sessid; } //int beg, end; //beg = end = -1; //if ((tmpckie != string.Empty) && (tmpckie != null)) // { // beg = tmpckie.IndexOf("sessionid="); // if (beg != -1) // { // beg += 10; // end = tmpckie.IndexOfAny(new char[] { ';', ',' }, beg); // if (end == -1) // sessionid = tmpckie.Substring(beg); // else // sessionid = tmpckie.Substring(beg, end - beg); // } // } } if (transurl != string.Empty) { if (sessionid == string.Empty) { TransferLogin(); } } if ((steamlogin != string.Empty) && (sessionid != string.Empty)) { cookie = "sessionid=" + sessionid + ";steamLogin="******"captcha_needed\":true")) { //{"success":false,"captcha_needed":false,"captcha_gid":-1,"message":"Incorrect login."} //{"success":false,"captcha_needed":true,"captcha_gid":"1317542928092269974","message":"Incorrect login."} captchaid = utils.GetStrBetween(resp, "captcha_gid\":\"", "\""); captchaurl = "https://steamcommunity.com/public/captcha.php?gid=" + captchaid; status = Constants.SignInStatus.CaptchaReqd; } //{"success":false,"message":"SteamGuard","emailauth_needed":true,"emaildomain":"yahoo.com","emailsteamid":"76561198060247951"} if (resp.Contains("emailauth_needed\":true")) { emailsteamid = utils.GetStrBetween(resp, "emailsteamid\":\"", "\""); status = Constants.SignInStatus.SGuardReqd; } authdone.Set(); }
public string 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, 100, 2000); if (post == string.Empty) { System.Threading.Thread.Sleep(2000); } else { break; } } ; string tmp = utils.GetStrBetween(post, "<groupID64>", "</groupID64>"); tmp = tmp.Replace(Environment.NewLine, string.Empty); if (tmp != string.Empty) { id = tmp; } tmp = utils.GetStrBetween(post, "<groupName>", "</groupName>"); 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)) { name = tmp.Substring(beg + 1, end - beg - 1); } } tmp = utils.GetStrBetween(post, "<groupURL>", "</groupURL>"); 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)) { url = tmp.Substring(beg + 1, end - beg - 1); } } tmp = utils.GetStrBetween(post, "<memberCount>", "</memberCount>"); tmp = tmp.Replace(Environment.NewLine, string.Empty); tmp = tmp.Replace(",", string.Empty); if (tmp != string.Empty) { try { total = Convert.ToInt32(tmp); } catch (Exception ex) { total = 0; } } tmp = utils.GetStrBetween(post, "<membersInGame>", "</membersInGame>"); tmp = tmp.Replace(Environment.NewLine, string.Empty); tmp = tmp.Replace(",", string.Empty); if (tmp != string.Empty) { try { ingame = Convert.ToInt32(tmp); } catch (Exception ex) { ingame = 0; } } tmp = utils.GetStrBetween(post, "<membersOnline>", "</membersOnline>"); tmp = tmp.Replace(Environment.NewLine, string.Empty); tmp = tmp.Replace(",", string.Empty); if (tmp != string.Empty) { try { online = Convert.ToInt32(tmp); } catch (Exception ex) { online = 0; } } tmp = utils.GetStrBetween(post, "<totalPages>", "</totalPages>"); tmp = tmp.Replace(Environment.NewLine, string.Empty); tmp = tmp.Replace(",", string.Empty); if (tmp != string.Empty) { try { npages = Convert.ToInt32(tmp); } catch (Exception ex) { npages = 0; } } tmp = utils.GetStrBetween(post, "<members>", "</members>"); return(tmp); }