/// <summary> /// This method is used for check Page status for new Acouunts created or not, after Page Document Completed /// </summary> public void CheckStatus() { try { bool Captchastatus = true; Email objemail = new Email(); if (webHotmail.ReadyState == WebBrowserReadyState.Complete) { if (webHotmail.Document.Body.OuterHtml.Contains("Sign out") || webHotmail.Document.Body.OuterHtml.Contains("sign out")) { try { objemail.username = Username; objemail.password = Password; DataSet ds = new DataSet(); Captchastatus = false; GlobusLogHelper.log.Info("EmaillAccount : Username : "******" Password : "******" has Created"); RaiseEvent(ds, new string[] { "Model : EmailRepository", "Function : InsertCreatedEmailinEmailDatatbase", Username, Password }); hotmailerStatus = HotmailerStatus.LoggedOut; //EmailAccountDataPath string CSVHeader = "Username"+","+"Password"; string CSV_Content = Username+","+Password; try { Globussoft.GlobusFileHelper.ExportDataCSVFile(CSVHeader, CSV_Content, EmailAccountDataPath); GlobusLogHelper.log.Debug("Data Saved In CSV ." + CSV_Content); GlobusLogHelper.log.Info("Data Saved In CSV ." + CSV_Content); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } Thread.Sleep(2000); this.Hide(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } if (webHotmail.Document.Body.OuterHtml.Contains("<BODY onload=javascript:rd();></BODY>") && webHotmail.Document.Body.OuterHtml.Count() < 200) { try { objemail.username = Username; objemail.password = Password; DataSet ds = new DataSet(); Captchastatus = false; GlobusLogHelper.log.Info("EmaillAccount : Username : "******" Password : "******" has Created"); RaiseEvent(ds, new string[] { "Model : EmailRepository", "Function : InsertCreatedEmailinEmailDatatbase", Username, Password }); hotmailerStatus = HotmailerStatus.LoggedOut; Thread.Sleep(2000); this.Hide(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } if (webHotmail.Document.Body.OuterHtml.Contains("<BODY></BODY>") && webHotmail.Document.Body.OuterHtml.Count() < 100) { try { objemail.username = Username; objemail.password = Password; DataSet ds = new DataSet(); Captchastatus = false; GlobusLogHelper.log.Info("EmaillAccount : Username : "******" Password : "******" has Created"); RaiseEvent(ds, new string[] { "Model : EmailRepository", "Function : InsertCreatedEmailinEmailDatatbase", Username, Password }); hotmailerStatus = HotmailerStatus.LoggedOut; Thread.Sleep(2000); this.Hide(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } if (webHotmail.Document.Body.OuterHtml.Contains("Sign Up Error 450")) { try { GlobusLogHelper.log.Error("Error : " + "Error 450 Track IP address"); hotmailerStatus = HotmailerStatus.LoggedOut; Thread.Sleep(2000); this.Hide(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } if (webHotmail.Document.Body.OuterHtml.Contains("Sign out and sign in with a different account")) { try { HtmlElementCollection h1 = (HtmlElementCollection)webHotmail.Document.GetElementsByTagName("A"); foreach (HtmlElement h2 in h1) { if (h2.OuterHtml.Contains("Sign out and sign in with a different account") || h2.OuterHtml.Contains("Sign out")) { h2.InvokeMember("click"); string outerhtml = h2.OuterHtml; string outerhref = outerhtml.Substring(outerhtml.IndexOf("href="), outerhtml.IndexOf("\">") - outerhtml.IndexOf("href=")).Replace("href=", "").Replace("\"", "").Trim(); webHotmail.Navigate(outerhref); break; } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } if (webHotmail.Document.Body.OuterHtml.Contains("The characters didn't match the picture. Please try again.") && Captchastatus == true) { try { FindCaptcha(); hotmailerStatus = HotmailerStatus.None; Thread.Sleep(2000); this.Hide(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
public void FillCaptcha() { try { string captcha = string.Empty; if (!string.IsNullOrEmpty(CurrentCaptchaUserName) && !string.IsNullOrEmpty(CurrentCaptchaPassword) && CheckDbcUserNamePassword) { captcha = ResolveCaptchaByCaptchaService(imageBytes, CurrentCaptchaSetting, CurrentCaptchaUserName, CurrentCaptchaPassword); } else { captcha= txtCaptcha.Text; } if (string.IsNullOrEmpty(captcha)) { MessageBox.Show("Please enter the Captcha Value Which you see on Captcha Image"); return; } Emails.EmailFactory hotemail = new Emails.HotmailFactory(); Emails.Email email = hotemail.createEmail(ref webHotmail, captcha, lstFname, lstLname); Username = email.username; Password = email.password; hotmailerStatus = HotmailerStatus.checkforAccountCreation; } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
public void LoadMainPageAndCreateIE() { try { webHotmail.Navigate(FBGlobals.Instance.createHotmailSignUpInboxUrl); hotmailerStatus = HotmailerStatus.SignUpPage; } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }