private void btnCheckPremAccount_Click(object sender, EventArgs e) { CheckNetConn = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable(); if (CheckNetConn) { try { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Process Running Please wait for sometimes... ]"); if (SearchCriteria.SignIN) { LinkedinLogin Login = new LinkedinLogin(); //For Sign Out Login.LogoutHttpHelper(); SearchCriteria.SignOut = true; } if (SearchCriteria.SignOut) { SearchCriteria.LoginID = string.Empty; if (LinkedInManager.linkedInDictionary.Count() > 0) { try { object temp = null; comboBoxemail.Invoke(new MethodInvoker(delegate { temp = comboBoxemail.SelectedItem; })); if (temp != null) { string acc = ""; comboBoxemail.Invoke(new MethodInvoker(delegate { acc = comboBoxemail.SelectedItem.ToString(); SearchCriteria.LoginID = comboBoxemail.SelectedItem.ToString(); })); //Run a separate thread for each account LinkedInMaster item = new LinkedInMaster(); LinkedInManager.linkedInDictionary.TryGetValue(acc, out item); item.logger.addToLogger += ScrapeEvent_addToLogger; item.LoginHttpHelper(ref HttpHelper); if (SearchCriteria.loginREsponce.Contains("Your LinkedIn account has been temporarily restricted")) { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ " + SearchCriteria.LoginID + "Your LinkedIn account has been temporarily restricted ]"); } if (SearchCriteria.loginREsponce.Contains("Please confirm your email address")) { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ " + SearchCriteria.LoginID + " account has been temporarily restricted Please confirm your email address ]"); } if (!item.IsLoggedIn) { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Couldn't Login With : " + acc + " ]"); return; } SearchCriteria.SignIN = true; SearchCriteria.SignOut = false; try { this.Invoke(new MethodInvoker(delegate { LoadCmboData(); })); } catch { } } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Check_Premium_Account() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Check_Premium_Account() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPreScrapperErrorLogs); } } } } catch { } } else { MessageBox.Show("Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection..."); AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection... ]"); } }
private void Method_comboBoxemail_SelectedIndexChanged() { try { //this.Invoke(new MethodInvoker(delegate //{ try { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Process Running Please wait for sometimes... ]"); if (SearchCriteria.SignIN) { LinkedinLogin Login = new LinkedinLogin(); //For Sign Out Login.LogoutHttpHelper(); SearchCriteria.SignOut = true; } if (SearchCriteria.SignOut) { SearchCriteria.LoginID = string.Empty; if (LinkedInManager.linkedInDictionary.Count() > 0) { try { object temp = null; comboBoxemail.Invoke(new MethodInvoker(delegate { temp = comboBoxemail.SelectedItem; })); if (temp != null) { //GlobusHttpHelper httpHelper = new GlobusHttpHelper(); string acc = ""; comboBoxemail.Invoke(new MethodInvoker(delegate { acc = comboBoxemail.SelectedItem.ToString(); SearchCriteria.LoginID = comboBoxemail.SelectedItem.ToString();//change 21/08/12 })); //string acc = account.Remove(account.IndexOf(':')); //Run a separate thread for each account LinkedInMaster item = new LinkedInMaster(); LinkedInManager.linkedInDictionary.TryGetValue(acc, out item); item.logger.addToLogger += ScrapeEvent_addToLogger; item.LoginHttpHelper(ref HttpHelper); if (item.IsLoggedIn) { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Logged in With : " + acc + " ]"); } if (SearchCriteria.loginREsponce.Contains("Your LinkedIn account has been temporarily restricted")) { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ " + SearchCriteria.LoginID + "Your LinkedIn account has been temporarily restricted ]"); } if (SearchCriteria.loginREsponce.Contains("Please confirm your email address")) { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ " + SearchCriteria.LoginID + " account has been temporarily restricted Please confirm your email address ]"); } if (!item.IsLoggedIn) { AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Couldn't Login With : " + acc + " ]"); return; } SearchCriteria.SignIN = true; SearchCriteria.SignOut = false; try { this.Invoke(new MethodInvoker(delegate { LoadCmboData(); })); } catch { } } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPreScrapperErrorLogs); } } } } catch { } //})); //DisableEnableScrapperControls(); } catch { } }