public void btnSubmitCapchaLogin_Click(object sender, EventArgs e) { try { Globals.CapchaTag = true; Globals.CapchaLoginID = txtCapchaID.Text; Globals.CapchaLoginPassword = txtCapchaPaswrd.Text; clsSettingDB ObjclsSettingDB = new clsSettingDB(); ObjclsSettingDB.InsertOrUpdateSetting("Captcha", "Captcha_ID", StringEncoderDecoder.Encode(txtCapchaID.Text)); ObjclsSettingDB.InsertOrUpdateSetting("Captcha", "Captcha_Password", StringEncoderDecoder.Encode(txtCapchaPaswrd.Text)); if (MessageBox.Show("Settings Saved !", "Notification", MessageBoxButtons.OK) == DialogResult.OK) { this.Close(); } } catch { } }
private void btnCreateOpenGroup_Click(object sender, EventArgs e) { CheckNetConn = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable(); if (CheckNetConn) { try { lstworkingThread.Clear(); if (IsStop) { IsStop = false; } if (!NumberHelper.ValidateNumber(txtGroupCreateMinDelay.Text)) { AddLoggerSearchGroup("[ " + DateTime.Now + " ] => [ Please Enter Valid Value in Minimum Delay ]"); MessageBox.Show("Please Enter Valid Value in Minimum Delay"); txtGroupCreateMinDelay.Focus(); return; } else if (!NumberHelper.ValidateNumber(txtGroupCreateMaxDelay.Text)) { AddLoggerSearchGroup("[ " + DateTime.Now + " ] => [ Please Enter Valid Value in Maximum Delay ]"); MessageBox.Show("Please Enter Valid Value in Maximum Delay"); txtGroupCreateMaxDelay.Focus(); return; } if (LinkedInManager.linkedInDictionary.Count() > 0 && lstLogoImage.Count > 0 && listGroupName.Count > 0 && listDesciption.Count > 0 && listSummary.Count > 0 && cmbLanguage.SelectedIndex > -1 && cmbGroupType.SelectedIndex > -1) { try { clsSettingDB ObjclsSettingDB = new clsSettingDB(); ObjclsSettingDB.InsertOrUpdateSetting("GroupCreator", "GroupName", StringEncoderDecoder.Encode(txtGroupName.Text)); ObjclsSettingDB.InsertOrUpdateSetting("GroupCreator", "GroupSummary", StringEncoderDecoder.Encode(txtSummary.Text)); ObjclsSettingDB.InsertOrUpdateSetting("GroupCreator", "GroupDescription", StringEncoderDecoder.Encode(txtDesc.Text)); ObjclsSettingDB.InsertOrUpdateSetting("GroupCreator", "GroupWebsite", StringEncoderDecoder.Encode(txtWebsite.Text)); } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> btnCreateOpenGroup_Click --> Storing Default File() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> btnCreateOpenGroup_Click --> Storing Default File() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinCreateGroupErrorLogs); } if (chkboxCreateOpenGrp.Checked) { SearchCriteria.CreateGroupStatus = "Open"; AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Starting Open Group Creation ]"); } else if (chkboxCreateMemGrp.Checked) { SearchCriteria.CreateGroupStatus = "Member"; AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Starting Member only Group Creation ]"); } try { string[] array = Regex.Split(GroupType, ";"); foreach (string item in array) { if (item.Contains(cmbGroupType.SelectedItem.ToString())) { string[] newArray = Regex.Split(item, ":"); SearchCriteria.GroupType = newArray[1]; } } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Create Group --> btnCreateOpenGroup_Click() ---cmbGroupType.SelectedItem--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Create Group --> btnCreateOpenGroup_Click() ---cmbGroupType.SelectedItem--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinCreateGroupErrorLogs); } try { Dictionary<string, string> GroupLanguage = new Dictionary<string, string>(); GroupLanguage = ObjSelectMethod.getLangauge(); string language = string.Empty; foreach (KeyValuePair<string, string> pair in GroupLanguage) { string CheckedString = cmbLanguage.SelectedItem.ToString(); if (CheckedString == pair.Key) { language = pair.Value; SearchCriteria.GroupLang = language; } } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Create Group --> btnCreateOpenGroup_Click() ---cmbLanguage.SelectedItem--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Create Group --> btnCreateOpenGroup_Click() ---cmbLanguage.SelectedItem--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinCreateGroupErrorLogs); } try { foreach (string item in listGroupName) { Que_Grpname_Post.Enqueue(item); } } catch { } try { foreach (string item in listDesciption) { Que_GrpDesc_Post.Enqueue(item); } } catch { } try { foreach (string item in listSummary) { Que_GrpSummary_Post.Enqueue(item); } } catch { } try { foreach (string item in listWebsite) { Que_Grpwebsite_Post.Enqueue(item); } } catch { } btnCreateOpenGroup.Cursor = Cursors.AppStarting; if (string.IsNullOrEmpty(txtCountPerAccount.Text)) { MessageBox.Show("Please enter the number of groups to be created per account"); AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Please enter the number of groups to be created per account ]"); return; } new Thread(() => { LinkdinCreateGroup(); }).Start(); } else { if (LinkedInManager.linkedInDictionary.Count() == 0) { MessageBox.Show("Please Load LinkedIn Accounts From MyAccounts Menu"); AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Please Load LinkedIn Accounts From MyAccounts Menu ]"); lbGeneralLogs.Items.Clear(); frmAccounts FrmAccount = new frmAccounts(); FrmAccount.Show(); return; } if (lstLogoImage.Count <= 0) { MessageBox.Show("Please Add Logo.."); AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Please Add Logo.. ]"); txtGroupLogo.Focus(); return; } else if (listGroupName.Count <= 0) { MessageBox.Show("Please Add GroupName.."); AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Please Add GroupName.. ]"); txtGroupName.Focus(); return; } else if (listSummary.Count <= 0) { MessageBox.Show("Please Add SelectGroupSummary.."); AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Please Add SelectGroupSummary..]"); txtSummary.Focus(); return; } else if (listDesciption.Count <= 0) { MessageBox.Show("Please Add GroupDesciption.."); AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Please Add GroupDesciption.. ]"); txtDesc.Focus(); return; } else if (cmbLanguage.SelectedIndex == -1) { MessageBox.Show("Please Select Language.."); AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Please Select Language.. ]"); cmbLanguage.Focus(); return; } else if (cmbGroupType.SelectedIndex == -1) { MessageBox.Show("Please Select GroupType.."); AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Please Select GroupType.. ]"); cmbGroupType.Focus(); return; } } } catch { } } else { MessageBox.Show("Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection..."); AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection... ]"); } }
private void btnStatusPost_Click(object sender, EventArgs e) { CheckNetConn = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable(); if (CheckNetConn) { try { lstStatusUpdateThread.Clear(); if (IsStop) { IsStop = false; } if (txtStatusUpd.Text.Contains("|")) { if (!(chkStatusSpintax.Checked)) { AddLoggerStatusUpdate("[ " + DateTime.Now + " ] => [ Please Check SpinTax CheckBox.. ]"); MessageBox.Show("Please Check SpinTax CheckBox.."); return; } if (txtStatusUpd.Text.Contains("{") || txtStatusUpd.Text.Contains("}")) { AddLoggerStatusUpdate("[ " + DateTime.Now + " ] => [ Its a wrong SpinTax Format.. ]"); MessageBox.Show("Its a wrong SpinTax Format.."); return; } } if (chkStatusSpintax.Checked) { //listStatusMessages.Add("Status") msg_spintaxtForStatusUpdate = true; //UpdatelistStatusUpdate = SpinnedListGenerator.GetSpinnedList(new List<string> { txtStatusUpd.Text }); statusSpin = GlobusSpinHelper.spinLargeText(new Random(), txtStatusUpd.Text); } else { msg_spintaxtForStatusUpdate = false; } if (!chkStatusSpintax.Checked) { if (listStatusMessages.Count == 0) { MessageBox.Show("Please Add Status Message for Post"); AddLoggerStatusUpdate("[ " + DateTime.Now + " ] => [ Please Add Status Message for Post ]"); return; } } // else if (UpdatelistStatusUpdate.Count == 0) else if (string.IsNullOrEmpty(statusSpin)) { MessageBox.Show("Please Add Status Message for Post"); AddLoggerStatusUpdate("[ " + DateTime.Now + " ] => [ Please Add Status Message for Post ]"); return; } if (LinkedInManager.linkedInDictionary.Count() == 0) { MessageBox.Show("Please Load LinkedIn Accounts From MyAccounts Menu"); AddLoggerStatusUpdate("[ " + DateTime.Now + " ] => [ Please Load LinkedIn Accounts From MyAccounts Menu ]"); lbGeneralLogs.Items.Clear(); frmAccounts FrmAccount = new frmAccounts(); FrmAccount.Show(); return; } else if (!NumberHelper.ValidateNumber(txtStatusUpdateMinDelay.Text)) { AddLoggerSearchGroup("[ " + DateTime.Now + " ] => [ Please Enter Valid Value in Minimum Delay ]"); MessageBox.Show("Please Enter Valid Value in Minimum Delay"); txtStatusUpdateMinDelay.Focus(); return; } else if (!NumberHelper.ValidateNumber(txtStatusUpdateMaxDelay.Text)) { AddLoggerSearchGroup("[ " + DateTime.Now + " ] => [ Please Enter Valid Value in Maximum Delay ]"); MessageBox.Show("Please Enter Valid Value in Maximum Delay"); txtStatusUpdateMaxDelay.Focus(); return; } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Status Update --> btnStatusPost_Click() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Status Update --> btnStatusPost_Click() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinStatusUpdateErrorLogs); } if (listStatusMessages.Count >= 0) { if (!chkStatusSpintax.Checked) { try { clsSettingDB ObjclsSettingDB = new clsSettingDB(); ObjclsSettingDB.InsertOrUpdateSetting("StatusUpdate", "StatusMessage", StringEncoderDecoder.Encode(txtStatusUpd.Text)); } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Status Update --> Storing Default File() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Status Update --> Storing Default File() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinStatusUpdateErrorLogs); } } btnStatusPost.Cursor = Cursors.AppStarting; new Thread(() => { LinkdinStatusUpdate(); }).Start(); } else { MessageBox.Show("Please upload Status Messages File"); AddLoggerStatusUpdate("[ " + DateTime.Now + " ] => [ Please upload Status Messages File ]"); } } else { MessageBox.Show("Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection..."); AddLoggerStatusUpdate("[ " + DateTime.Now + " ] => [ Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection... ]"); } }
public void LoadAccounts() { try { int countAccount = 0; if (Globals.IsFreeVersion) { //try //{ // string DeleteQuery = "Delete from tb_LinkedInAccount"; // DataBaseHandler.DeleteQuery(DeleteQuery, "tb_LinkedInAccount"); // LoadDataGrid(); //} //catch (Exception) //{ //} try { btnClearAccounts.Enabled = false; DataTable dt1 = objclsLinkedINAccount.SelectAccoutsForGridView(); countAccount = dt1.Rows.Count; if (countAccount >= 5) { return; } else { countAccount = 5 - countAccount; } } catch (Exception) { } } DataTable dt = new DataTable(); using (OpenFileDialog ofd = new OpenFileDialog()) { ofd.Filter = "Text Files (*.txt)|*.txt"; ofd.InitialDirectory = Application.StartupPath; if (ofd.ShowDialog() == DialogResult.OK) { this.Invoke(new MethodInvoker(delegate { txtAccountFile.Text = ofd.FileName; clsSettingDB ObjclsSettingDB = new clsSettingDB(); ObjclsSettingDB.InsertOrUpdateSetting("LoadAccounts", "LoadAccounts", StringEncoderDecoder.Encode(txtAccountFile.Text)); })); List <string> templist = GlobusFileHelper.ReadFiletoStringList(ofd.FileName); Ld_lstAccountCheckerEmail.AddRange(templist); int countlist = templist.Count(); if (Globals.IsFreeVersion) { try { //templist.RemoveRange(5, templist.Count - 5); templist.RemoveRange(countAccount, templist.Count - countAccount); } catch { } foreach (string item in templist) { LoadDBAccount(item); } LoadGridView(); if (countlist > 5) { try { this.Invoke(new MethodInvoker(delegate { FrmFreeTrial frmFreeTrial = new FrmFreeTrial(); frmFreeTrial.TopMost = true; frmFreeTrial.BringToFront(); frmFreeTrial.ShowDialog(); })); } catch (Exception) { } } this.Invoke(new MethodInvoker(delegate { this.Close(); })); } else { foreach (string item in templist) { LoadDBAccount(item); } LoadGridView(); } } AddLoggerAccountLoad("[ " + DateTime.Now + " ] => [ " + LinkedInManager.linkedInDictionary.Count + " Accounts loaded ]"); //AddLoggerAccounts(LinkedInManager.linkedInDictionary.Count + " Accounts loaded"); Log("[ " + DateTime.Now + " ] => [ " + LinkedInManager.linkedInDictionary.Count + " Accounts loaded ]"); } } catch { } }
public void LoadAccounts() { try { int countAccount = 0; if (Globals.IsFreeVersion) { //try //{ // string DeleteQuery = "Delete from tb_LinkedInAccount"; // DataBaseHandler.DeleteQuery(DeleteQuery, "tb_LinkedInAccount"); // LoadDataGrid(); //} //catch (Exception) //{ //} try { btnClearAccounts.Enabled = false; DataTable dt1 = objclsLinkedINAccount.SelectAccoutsForGridView(); countAccount = dt1.Rows.Count; if (countAccount >= 5) { return; } else { countAccount = 5 - countAccount; } } catch (Exception) { } } DataTable dt = new DataTable(); using (OpenFileDialog ofd = new OpenFileDialog()) { ofd.Filter = "Text Files (*.txt)|*.txt"; ofd.InitialDirectory = Application.StartupPath; if (ofd.ShowDialog() == DialogResult.OK) { this.Invoke(new MethodInvoker(delegate { txtAccountFile.Text = ofd.FileName; clsSettingDB ObjclsSettingDB = new clsSettingDB(); ObjclsSettingDB.InsertOrUpdateSetting("LoadAccounts", "LoadAccounts", StringEncoderDecoder.Encode(txtAccountFile.Text)); })); List<string> templist = GlobusFileHelper.ReadFiletoStringList(ofd.FileName); Ld_lstAccountCheckerEmail.AddRange(templist); int countlist = templist.Count(); if (Globals.IsFreeVersion) { try { //templist.RemoveRange(5, templist.Count - 5); templist.RemoveRange(countAccount, templist.Count - countAccount); } catch { } foreach (string item in templist) { LoadDBAccount(item); } LoadGridView(); if (countlist > 5) { try { this.Invoke(new MethodInvoker(delegate { FrmFreeTrial frmFreeTrial = new FrmFreeTrial(); frmFreeTrial.TopMost = true; frmFreeTrial.BringToFront(); frmFreeTrial.ShowDialog(); })); } catch (Exception) { } } this.Invoke(new MethodInvoker(delegate { this.Close(); })); } else { foreach (string item in templist) { LoadDBAccount(item); } LoadGridView(); } } AddLoggerAccountLoad("[ " + DateTime.Now + " ] => [ " + LinkedInManager.linkedInDictionary.Count + " Accounts loaded ]"); //AddLoggerAccounts(LinkedInManager.linkedInDictionary.Count + " Accounts loaded"); Log("[ " + DateTime.Now + " ] => [ " + LinkedInManager.linkedInDictionary.Count + " Accounts loaded ]"); } } catch { } }