Exemplo n.º 1
0
 public void GetStep1MatchGroup()
 {
     try
     {
         if ((base._isLoginSuccess && !base._isGettingData) && (DateTime.Now.Subtract(base._datLatestSpiderStart).TotalMilliseconds > base._intSpiderMinimumIntervalMS))
         {
             base._datLatestSpiderStart = DateTime.Now;
             base._isGettingData = true;
             HttpWebRequest request = (HttpWebRequest) WebRequest.Create(base._strRootURL + "_TotalBets/HDPOU.aspx");
             this.RaiseProgramLogEventWrapper("Start getting membet bets (Step 1)...");
             request.Timeout = 0x4e20;
             request.Method = "GET";
             request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
             request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
             request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
             request.Headers.Add("Accept-Encoding", "gzip, deflate");
             request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
             request.KeepAlive = true;
             request.Referer = base._strRootURL + "Menu2.aspx";
             request.Headers["Cookie"] = base._objCookieList.ToString();
             WebRequestState state = new WebRequestState(request);
             ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteStep1), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackStep1), state, 0x4e20, true);
         }
     }
     catch (Exception exception1)
     {
         ProjectData.SetProjectError(exception1);
         Exception exception = exception1;
         base._isGettingData = false;
         base._intBadSpiderRequest++;
         base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetStep1MatchGroup: " + exception.Message);
         this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetStep1MatchGroup: " + exception.Message);
         ProjectData.ClearProjectError();
     }
 }
Exemplo n.º 2
0
 private bool GetFullOddsFromServer(bool flag1)
 {
     bool flag2 = false;
     if (base._objPostList.Count > 0)
     {
         base._isGettingFullOdds = true;
         try
         {
             flag2 = true;
             base._strSpiderFullPost = base._objPostList[0].get_Value();
             base._strSpiderURL = base._objPostList[0].get_Name();
             base._datLatestSpiderStepStart = DateTime.Now;
             if (!flag1)
             {
                 base._datLatestSpiderStart = DateTime.Now;
             }
             this.RaiseProgramLogEventWrapper("Start getting odds(" + Conversions.ToString(base._objPostList.Count) + ")...");
             HttpWebRequest request = (HttpWebRequest) WebRequest.Create(base._strSpiderURL);
             request.Timeout = 0x7530;
             request.ReadWriteTimeout = 0x3a98;
             request.Headers.Add("Accept-Encoding", "gzip, deflate");
             request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.17) Gecko/2009122116 Firefox/3.0.17 GTBDFff GTB7.0";
             request.Method = "GET";
             request.ContentType = "application/x-www-form-urlencoded";
             request.AllowAutoRedirect = true;
             request.Headers["Cookie"] = base._objCookieList.ToString();
             WebRequestState state = new WebRequestState(request);
             ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteFullOdds), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackContent), state, 0x7530, true);
         }
         catch (Exception exception1)
         {
             ProjectData.SetProjectError(exception1);
             Exception exception = exception1;
             base._isGettingFullOdds = false;
             this.WriteProgramLogger(base._strName + ": Error from GetFullOddsFromServer: " + exception.Message);
             this.RaiseEventSpiderFullOddsComplete(base._strName, false);
             ProjectData.ClearProjectError();
         }
     }
     return flag2;
 }
Exemplo n.º 3
0
 protected void GetStep2MatchDetailsRecursive(int num1)
 {
     try
     {
         List<string> list = CommonFunction.SeperateStringBySymbol2(Conversions.ToString(base._objMatchGroupList[num1]), ",");
         HttpWebRequest request = (HttpWebRequest) WebRequest.Create(base._strRootURL + "BetList/BetList.aspx?matchId=" + list[0] + "&betType=" + list[1] + "&type=" + CommonFunction.TrimSymbol(list[2], "'"));
         this.RaiseProgramLogEventWrapper("Start getting membet bets (Step 2)...");
         request.Timeout = 0x4e20;
         request.Method = "GET";
         request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
         request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
         request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
         request.Headers.Add("Accept-Encoding", "gzip, deflate");
         request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
         request.KeepAlive = true;
         request.Referer = base._strRootURL + "TotalBets/HDPOU.aspx";
         request.Headers["Cookie"] = base._objCookieList.ToString();
         WebRequestState state = new WebRequestState(request);
         ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteStep2), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackStep2), state, 0x4e20, true);
     }
     catch (Exception exception1)
     {
         ProjectData.SetProjectError(exception1);
         Exception exception = exception1;
         base._isGettingData = false;
         base._intBadSpiderRequest++;
         base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetStep1MatchGroup: " + exception.Message);
         this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetStep1MatchGroup: " + exception.Message);
         ProjectData.ClearProjectError();
     }
 }
Exemplo n.º 4
0
 private void ReadCallBackFullOdds(IAsyncResult result1)
 {
     try
     {
         HttpWebRequest asyncState = (HttpWebRequest)result1.AsyncState;
         Stream stream = asyncState.EndGetRequestStream(result1);
         string s = base._strSpiderFullPost;
         byte[] bytes = Encoding.UTF8.GetBytes(s);
         stream.Write(bytes, 0, s.Length);
         stream.Close();
         WebRequestState state = new WebRequestState(asyncState);
         ThreadPool.RegisterWaitForSingleObject(asyncState.BeginGetResponse(new AsyncCallback(this.RequestCompleteFullOdds), asyncState).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackContent), state, 0x3a98, true);
         base.allDone.Set();
     }
     catch (Exception exception1)
     {
         ProjectData.SetProjectError(exception1);
         Exception exception = exception1;
         base._isGettingFullOdds = false;
         base._intBadSpiderRequest++;
         base._intSpiderErrorCountCurrent++;
         if (base._intSpiderErrorCountCurrent >= base._intSpiderErrorCountLimit)
         {
             base._isLoginSuccess = false;
             base._objErrorLogger.write(base._strName + ": EXCEPTION IN ReadCallBackFullOdds: Get Odds failed, account has been logged out!");
             this.WriteProgramLogger(base._strName + ": EXCEPTION IN ReadCallBackFullOdds: Get Odds failed, account has been logged out!");
         }
         base._objErrorLogger.write(base._strName + ": EXCEPTION IN ReadCallBackFullOdds: " + exception.Message);
         this.WriteProgramLogger(base._strName + ": EXCEPTION IN ReadCallBackFullOdds: " + exception.Message);
         this.RaiseEventSpiderFullOddsComplete(base._strName, false);
         ProjectData.ClearProjectError();
     }
 }
Exemplo n.º 5
0
        private void ReadCallBackLoginCheckIn(IAsyncResult result1)
        {
            try
            {
                HttpWebRequest asyncState = (HttpWebRequest)result1.AsyncState;

                Stream stream = asyncState.EndGetRequestStream(result1);
                string s = "username="******": EXCEPTION IN ReadCallBackLoginCheckIn: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN ReadCallBackLoginCheckIn: " + exception.Message);
                ProjectData.ClearProjectError();
            }
        }
Exemplo n.º 6
0
        private bool GetLoginCheckInFromServer()
        {
            bool flag2 = false;
            try
            {
                string str = "username="******"/login_checkin.aspx");
                request.Timeout = 0x7530;
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.17) Gecko/2009122116 Firefox/3.0.17 GTBDFff GTB7.0";
                request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
                request.Headers.Add("Accept-Encoding", "gzip, deflate");
                request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                request.Referer = base._strRootURL + "/topmenu.aspx";
                request.Method = "POST";
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.ContentLength = str.Length;

                WebRequestState state = new WebRequestState(request);

                Stream stream = request.GetRequestStream();
                byte[] bytes = Encoding.UTF8.GetBytes(str);
                stream.Write(bytes, 0, str.Length);
                stream.Close();

                ThreadPool.RegisterWaitForSingleObject(request.BeginGetRequestStream(new AsyncCallback(this.RequestCompleteLoginCheckIn), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackLoginCheckIn), state, 0x7530, true);
                base.allDone.WaitOne();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetLoginCheckInFromServer: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetLoginCheckInFromServer: " + exception.Message);
                ProjectData.ClearProjectError();
            }
            return flag2;
        }
Exemplo n.º 7
0
 private bool GetFullOddsFromServer(bool flag1)
 {
     bool flag2 = false;
     //if (base._objPostList.Count > 0)
     if (base.sportURLList.Count > 0)
     {
         base._isGettingFullOdds = true;
         try
         {
             flag2 = true;
             //base._strSpiderFullPost = base._objPostList[0].get_Value();
             //base._strSpiderURL = base._objPostList[0].get_Name();
             //base._datLatestSpiderStepStart = DateTime.Now;
             if (!flag1)
             {
                 base._datLatestSpiderStart = DateTime.Now;
             }
             this.RaiseProgramLogEventWrapper("Start getting odds...");
             HttpWebRequest request = (HttpWebRequest)WebRequest.Create(base._strSpiderURL);
             request.Timeout = 0x9C40;
             request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.17) Gecko/2009122116 Firefox/3.0.17 GTBDFff GTB7.0";
             request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
             request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
             request.Headers.Add("Accept-Encoding", "gzip, deflate");
             request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
             request.Referer = base._strRootURL + "/UnderOver.aspx?Market=t&DispVer=new";
             request.Method = "GET";
             request.Headers["Cookie"] = base._objCookieList.ToString();
             WebRequestState state = new WebRequestState(request);
             ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteFullOdds), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackContent), state, 0x9C40, true);
         }
         catch (Exception exception1)
         {
             ProjectData.SetProjectError(exception1);
             Exception exception = exception1;
             base._isGettingFullOdds = false;
             base._intBadSpiderRequest++;
             base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetFullOddsFromServer: " + exception.Message);
             this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetFullOddsFromServer: " + exception.Message);
             this.RaiseEventSpiderFullOddsComplete(base._strName, false);
             ProjectData.ClearProjectError();
         }
     }
     return flag2;
 }
Exemplo n.º 8
0
 private bool GetFullOddsFromServer(bool flag1)
 {
     bool flag2 = false;
     if (base._objPostList.Count > 0)
     {
         base._isGettingFullOdds = true;
         try
         {
             flag2 = true;
             base._strSpiderURL = base._objPostList[0].get_Name();
             base._datLatestSpiderStepStart = DateTime.Now;
             if (!flag1)
             {
                 base._datLatestSpiderStart = DateTime.Now;
             }
             this.RaiseProgramLogEventWrapper("Start getting odds(" + Conversions.ToString(base._objPostList.Count) + ")...");
             HttpWebRequest request = (HttpWebRequest) WebRequest.Create(base._strSpiderURL);
             request.Timeout = 0x1388;
             request.Method = "GET";
             request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16 GTBDFff GTB7.0";
             request.Accept = "application/json, text/javascript, */*";
             request.Headers.Add(HttpRequestHeader.AcceptLanguage, "Accept-Language");
             request.Headers.Add("Accept-Encoding", "gzip, deflate");
             request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
             request.Referer = base._strRootURL + "/english/index.php?p=user_main";
             request.Headers.Add("X-Requested-With", "XMLHttpRequest");
             request.Headers["Cookie"] = base._objCookieList.ToString();
             request.ContentLength = 0L;
             WebRequestState state = new WebRequestState(request);
             ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteFullOdds), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackContent), state, 0x2710, true);
         }
         catch (Exception exception1)
         {
             ProjectData.SetProjectError(exception1);
             Exception exception = exception1;
             base._isGettingFullOdds = false;
             base._intBadSpiderRequest++;
             base._intSpiderErrorCountCurrent++;
             if (base._intSpiderErrorCountCurrent >= base._intSpiderErrorCountLimit)
             {
                 base._isLoginSuccess = false;
                 base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetFullOddsFromServer: Get Odds failed, account has been logged out!");
                 this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetFullOddsFromServer: Get Odds failed, account has been logged out!");
             }
             base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetFullOddsFromServer: " + exception.Message);
             this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetFullOddsFromServer: " + exception.Message);
             this.RaiseEventSpiderFullOddsComplete(base._strName, false);
             ProjectData.ClearProjectError();
         }
     }
     return flag2;
 }