Exemplo n.º 1
0
        public bool Start(LoginFbInfo fbInfo)
        {
            this.fbInfo = fbInfo;
            try
            {
                string redirectUrl = string.Empty;
                string result      = web.SendRequest("https://www.facebook.com/help/", "GET", "www.facebook.com", null, ref redirectUrl, false, true);
                Thread.Sleep(1000 * rand.Next(1, 5));

                result = web.SendRequest("https://www.facebook.com/help/", "GET", "www.facebook.com", null, ref redirectUrl, false, false);
                Thread.Sleep(1000 * rand.Next(1, 5));
                string loginResult = Login();
                if (!string.IsNullOrEmpty(loginResult) && !loginResult.Contains("checkpoint"))
                {
                    string refStr = string.Empty;
                    Thread.Sleep(1000 * rand.Next(1, 5));
                    result = web.SendRequest(loginResult, "GET",
                                             "www.facebook.com", null, ref refStr, false, false);
                    return(true);
                }
            }
            catch (Exception ex)
            {
                if (NotifyLogLabelUI != null)
                {
                    NotifyLogLabelUI(this, "Error: " + ex.Message);
                }
                logger.ErrorFormat("Error: {0}, Details: {1}", ex.Message, ex.StackTrace);
            }
            return(false);
        }
Exemplo n.º 2
0
        public bool Start(LoginFbInfo fbInfo)
        {
            this.fbInfo = fbInfo;
            try
            {
                if (driver == null)
                {
                    Init();
                }


                return(CheckLogin());
            }
            catch (Exception ex)
            {
                if (NotifyLogLabelUI != null)
                {
                    NotifyLogLabelUI(this, "Error: " + ex.Message);
                }
                logger.ErrorFormat("Error: {0}, Details: {1}", ex.Message, ex.StackTrace);
            }
            return(false);
        }