예제 #1
0
        public void LoadFileData()
        {
            string accountData = string.Empty;
            string laoddata    = string.Empty;

            clsDBQueryManager DataBase = new clsDBQueryManager();
            DataTable         dt       = DataBase.SelectSettingData();

            foreach (DataRow row in dt.Rows)
            {
                if ("LoadAccounts" == row[1].ToString())
                {
                    accountData = StringEncoderDecoder.Decode(row[2].ToString());
                }
            }

            if (File.Exists(accountData))
            {
                txtAccountFile.Text = accountData;
                AddToListBox("[ " + DateTime.Now + " ] => [ Last Accounts Loaded From : " + accountData + " ]");
            }
            else
            {
                AddToListBox("[ " + DateTime.Now + " ] => [ File : " + accountData + " : Does not exsist ]");
            }
        }
예제 #2
0
        private void FrmCapchaLogin_Load(object sender, EventArgs e)
        {
            try
            {
                Globals.CapchaTag = true;
                image             = Properties.Resources.background;
                txtDBpath.Text    = Globals.path_AppDataFolder;

                clsDBQueryManager DataBase = new clsDBQueryManager();
                DataTable         dt       = DataBase.SelectSettingData();
                foreach (DataRow dRow in dt.Rows)
                {
                    if ("Captcha_ID" == dRow[1].ToString())
                    {
                        txtCapchaID.Text = StringEncoderDecoder.Decode(dRow[2].ToString());
                    }
                    if ("Captcha_Password" == dRow[1].ToString())
                    {
                        txtCapchaPaswrd.Text = StringEncoderDecoder.Decode(dRow[2].ToString());
                    }

                    Globals.CapchaLoginID       = txtCapchaID.Text;
                    Globals.CapchaLoginPassword = txtCapchaPaswrd.Text;
                }

                //string[] arr1 = new string[] { BaseLib.Globals.CapchaLoginID, BaseLib.Globals.CapchaLoginPassword};
                //DeathByCaptcha.Client clnt = null;
                //string capcthaResponse = DecodeDBC(arr1, out clnt);
            }
            catch
            {
            }
        }
예제 #3
0
        private void btnSaveDBC_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtDBCUsername.Text.Trim()) && !string.IsNullOrEmpty(txtDBCPassword.Text.Trim()))
            {
                BaseLib.Globals.DBCUsername = txtDBCUsername.Text;
                BaseLib.Globals.DBCPassword = txtDBCPassword.Text;

                //***  Save tb_Setting**************************///////

                clsDBQueryManager objclsSettingDB = new clsDBQueryManager();

                try
                {
                    DataTable dt = objclsSettingDB.SelectSettingData();
                    foreach (DataRow row in dt.Rows)
                    {
                        if ("DeathByCaptcha" == row[1].ToString())
                        {
                            objclsSettingDB.DeleteDBCDecaptcherData("DeathByCaptcha");
                        }
                    }
                    objclsSettingDB.InsertDBCData(StringEncoderDecoder.Encode(txtDBCUsername.Text), "DeathByCaptcha", StringEncoderDecoder.Encode(txtDBCPassword.Text));
                    MessageBox.Show("Settings Saved");
                    this.Close();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
            }
            else
            {
                MessageBox.Show("Please fill all Death By Captcha Details");
            }
        }
예제 #4
0
        //Code added by Lijo For tweeting with images in the wait and reply module
        public void TweetMessageWithImage(ref Globussoft.GlobusHttpHelper globusHttpHelper, string postAuthenticityToken, string tweetMessage, string ImageFilePath, out string status)
        {
            string status1     = string.Empty;
            bool   IsLocalFile = true;
            string MediaId     = string.Empty;

            ///Read Image Data in Byte
            ///convert byte in base 64 string
            try
            {
                string _base64String = Convert.ToBase64String(File.ReadAllBytes(ImageFilePath));

                try
                {
                    _base64String = StringEncoderDecoder.EncodeBase64String(_base64String);
                }
                catch
                {
                }
                ///call method for posting
                ///
                string txid = (UnixTimestampFromDateTime(System.DateTime.Now) * 1000).ToString();

                string postData  = "authenticity_token=" + postAuthenticityToken + "&iframe_callback=&media=" + _base64String + "&upload_id=" + txid + "&origin=https%3A%2F%2Ftwitter.com";
                string response_ = globusHttpHelper.postFormData(new Uri("https://upload.twitter.com/i/media/upload.iframe?origin=https%3A%2F%2Ftwitter.com"), postData, "https://twitter.com/", "", "", "", "https://twitter.com/");

                MediaId = globusHttpHelper.getBetween(response_, "snowflake_media_id\":", ",").Replace("snowflake_media_id\":", "").Trim();

                string finalpostdata = "authenticity_token=" + postAuthenticityToken + "&media_ids=" + MediaId + "&place_id=&status=" + tweetMessage.Replace(" ", "+") + "&tagged_users=";

                response_ = globusHttpHelper.postFormData(new Uri("https://twitter.com/i/tweet/create"), finalpostdata, "https://twitter.com/", "", "XMLHttpRequest", "", "https://twitter.com/");

                //globusHttpHelper.HttpUploadImageFileWithMessage("https://upload.twitter.com/i/tweet/create_with_media.iframe", ImageFilePath, "media_data[]", "application/octet-stream", nvc, true, ref status1);

                //if (status1 == "okay")
                //{
                //    status1 = "posted";
                //}

                if (response_.Contains("tweet_id"))
                {
                    status1 = "posted";
                }
            }
            catch (Exception ex)
            {
                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TweetMessageWithImagePostData() -- Tweet -- que_TweetMessages_Hashtags --> " + ex.Message, Globals.Path_TweetingErroLog);
                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TweetMessageWithImagePostData() --  Tweet -- que_TweetMessages_Hashtags  --> " + ex.Message, Globals.Path_TweetAccountManager);
            }
            status = status1;
        }
예제 #5
0
        private void LoadDefaultsFiles()
        {
            try
            {
                #region TD Ubdate by me
                lstMessage.Clear();


                string MessageSettings = string.Empty;


                #endregion

                //Globussoft1.GlobusHttpHelper
                DataTable dt = objclsSettingDB.SelectSettingData();
                foreach (DataRow row in dt.Rows)
                {
                    try
                    {
                        if ("MentionReplyInterface" == row[0].ToString())
                        {
                            if ("Message" == row[1].ToString())
                            {
                                MessageSettings = StringEncoderDecoder.Decode(row[2].ToString());
                            }
                        }
                    }
                    catch
                    {
                    }
                }

                if (File.Exists(MessageSettings))
                {
                    lstMessage    = GlobusFileHelper.ReadFiletoStringList(MessageSettings);
                    textBox1.Text = MessageSettings;
                    BindDataIntoDropDownList();
                    AddToReplyInterfaceLog("[ " + DateTime.Now + " ] => [ " + lstMessage.Count + " Message loaded ]");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
        }
예제 #6
0
        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
            {
            }
        }
예제 #7
0
        private void LoadDBCSettings()
        {
            clsDBQueryManager objclsSettingDB = new clsDBQueryManager();

            try
            {
                DataTable dt = objclsSettingDB.SelectSettingData();
                foreach (DataRow row in dt.Rows)
                {
                    if ("DeathByCaptcha" == row[1].ToString())
                    {
                        txtDBCUsername.Text         = StringEncoderDecoder.Decode(row[0].ToString());
                        txtDBCPassword.Text         = StringEncoderDecoder.Decode(row[2].ToString());
                        BaseLib.Globals.DBCUsername = StringEncoderDecoder.Decode(txtDBCUsername.Text);
                        BaseLib.Globals.DBCPassword = StringEncoderDecoder.Decode(txtDBCPassword.Text);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
        }
예제 #8
0
        public static void LoadDecaptchaSettings()
        {
            try
            {
                Globals.CapchaTag = true;

                clsDBQueryManager DataBase = new clsDBQueryManager();
                DataTable         dt       = DataBase.SelectSettingData();
                foreach (DataRow dRow in dt.Rows)
                {
                    if ("Captcha_ID" == dRow[1].ToString())
                    {
                        Globals.CapchaLoginID = StringEncoderDecoder.Decode(dRow[2].ToString());
                    }
                    if ("Captcha_Password" == dRow[1].ToString())
                    {
                        Globals.CapchaLoginPassword = StringEncoderDecoder.Decode(dRow[2].ToString());
                    }
                }
            }
            catch
            {
            }
        }
        public void startRePin()
        {
            try
            {
                if (PDGlobals.listAccounts.Count > 0)
                {
                    objRePinManager.isStopRePin = false;
                    objRePinManager.lstThreadsRePin.Clear();
                    clsSettingDB Database = new clsSettingDB();
                    Database.UpdateSettingData("Repin", "RepinMsgFile", StringEncoderDecoder.Encode(txtRepinMessage_Repin.Text));
                    Database.UpdateSettingData("Repin", "RepinNO", StringEncoderDecoder.Encode(txtRepinNo_Repin.Text));

                    ClGlobul.lstPins.Clear();

                    int processorCount = objUtils.GetProcessor();

                    int threads = 25;

                    int maxThread = 25 * processorCount;
                    try
                    {
                        try
                        {
                            objRePinManager.minDelayRePin     = Convert.ToInt32(txtRepin_DelayMin.Text);
                            objRePinManager.maxDelayRePin     = Convert.ToInt32(txtRepin_DelayMax.Text);
                            objRePinManager.Nothread_RePin    = Convert.ToInt32(txtRepinNoOfThreads_RePin.Text);
                            objRePinManager.maxNoOfRePinCount = Convert.ToInt32(txtRepinCount.Text);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Info("Enter in Correct Format");
                            return;
                        }
                        Regex checkNo = new Regex("^[0-9]*$");

                        if (!string.IsNullOrEmpty(txtRepinNoOfThreads_RePin.Text) && checkNo.IsMatch(txtRepinNoOfThreads_RePin.Text))
                        {
                            threads = Convert.ToInt32(txtRepinNoOfThreads_RePin.Text);
                        }

                        if (threads > maxThread)
                        {
                            threads = 25;
                        }
                        GlobusLogHelper.log.Info(" => [ Process Starting ] ");
                        objRePinManager.NoOfThreadsRePin = threads;

                        Thread RePinThread = new Thread(objRePinManager.StartRepin);
                        RePinThread.Start();
                    }

                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
                else
                {
                    GlobusLogHelper.log.Info("Please Load Accounts !");
                    GlobusLogHelper.log.Debug("Please Load Accounts !");
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
        }
예제 #10
0
        public DataSet SelectStatusIdUserNameTweetAndReplyFromtb_ReplyCampaign(string statusId, string UserName, string tweet, string reply)
        {
            DataSet ds = new DataSet();

            try
            {
                string query = "Select StatusId, UserName ,TweetText, Reply from tb_ReplyCampaign where StatusId='" + StringEncoderDecoder.Encode(statusId) + "' and UserName='******' and TweetText='" + StringEncoderDecoder.Encode(tweet) + "' and Reply='" + StringEncoderDecoder.Encode(reply) + "'";
                ds = DataBaseHandler.SelectQuery(query, "tb_ReplyCampaign");
            }
            catch
            {
            }
            return(ds);
        }
예제 #11
0
        public void startFollowByUsername()
        {
            try
            {
                if (PDGlobals.listAccounts.Count > 0)
                {
                    try
                    {
                        if (objFollowByUsernameManager.rdbSingleUserFollowByUsername == true || objFollowByUsernameManager.rdbMultipleUserFollowByUsername == true)
                        {
                            try
                            {
                                #region Single User
                                if (objFollowByUsernameManager.rdbSingleUserFollowByUsername == true)
                                {
                                    try
                                    {
                                        if (rdoFollowUserUploaded.IsChecked == true || rdoFollowFollowers.IsChecked == true)
                                        {
                                            if (rdoFollowUserUploaded.IsChecked == true)
                                            {
                                            }
                                            if (rdoFollowFollowers.IsChecked == true)
                                            {
                                            }
                                        }
                                        else
                                        {
                                            GlobusLogHelper.log.Info("Please Select Follow Upload User or Follow users Follower");
                                            ModernDialog.ShowMessage("Please Select Follow Upload User or Follow users Follower", "Follow Upload User or Follow users Follower", MessageBoxButton.OK);
                                            return;
                                        }
                                    }
                                    catch (Exception ex)
                                    { };
                                }
                                #endregion

                                #region Multiple User
                                if (objFollowByUsernameManager.rdbMultipleUserFollowByUsername == true)
                                {
                                    try
                                    {
                                        if (rdoFollowUserUploaded.IsChecked == true || rdoFollowFollowers.IsChecked == true)
                                        {
                                            if (rdoFollowUserUploaded.IsChecked == true)
                                            {
                                                if (string.IsNullOrEmpty(txtUsernameUpload.Text))
                                                {
                                                    GlobusLogHelper.log.Info("Please Upload Username ");
                                                    ModernDialog.ShowMessage("Please Upload Username", "Upload Username", MessageBoxButton.OK);
                                                    return;
                                                }
                                                else
                                                {
                                                    foreach (var itemListOfFollowUsersFollowers in ClGlobul.ListOfFollowUsersFollowers)
                                                    {
                                                        objFollowByUsernameManager.FollowUsersFollowerQueue.Enqueue(itemListOfFollowUsersFollowers);
                                                    }
                                                }
                                            }

                                            if (rdoFollowFollowers.IsChecked == true)
                                            {
                                                if (string.IsNullOrEmpty(txtFollowUserUpload.Text))
                                                {
                                                    GlobusLogHelper.log.Info("Please Upload Follow User ");
                                                    ModernDialog.ShowMessage("Please Upload Follow User", "Upload Follow User", MessageBoxButton.OK);
                                                    return;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            GlobusLogHelper.log.Info("Please Select Follow Upload User or Follow users Follower");
                                            ModernDialog.ShowMessage("Please Select Follow Upload User or Follow users Follower", "Follow Upload User or Follow users Follower", MessageBoxButton.OK);
                                            return;
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                                    }
                                }
                                #endregion
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                            }
                        }
                        else
                        {
                            GlobusLogHelper.log.Info("Please Select Use Single User or Use Multiple User");
                            ModernDialog.ShowMessage("Please Select Use Single User or Use Multiple User", "Select Use Single User or Use Multiple User", MessageBoxButton.OK);
                            return;
                        }

                        objFollowByUsernameManager.isStopFollowByUsername = false;
                        objFollowByUsernameManager.lstThreadsFollowByUsername.Clear();

                        if (objFollowByUsernameManager._IsfevoriteFollowByUsername)
                        {
                            objFollowByUsernameManager._IsfevoriteFollowByUsername = false;
                        }

                        Regex checkNo = new Regex("^[0-9]*$");

                        int processorCount = objUtils.GetProcessor();

                        int threads = 25;

                        int maxThread = 25 * processorCount;
                        try
                        {
                            try
                            {
                                objFollowByUsernameManager.minDelayFollowByUsername  = Convert.ToInt32(txtFollowByUsername_DelayMin.Text);
                                objFollowByUsernameManager.maxDelayFollowByUsername  = Convert.ToInt32(txtFollowByUsername_DelayMax.Text);
                                objFollowByUsernameManager.Nothread_FollowByUsername = Convert.ToInt32(txtFollowByUsername_NoOfThreads.Text);
                                objFollowByUsernameManager.MaxFollowCount            = Convert.ToInt32(txtFollowerCount.Text);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Info("Enter in Correct Format");
                                return;
                            }

                            QM.UpdateSettingData("Follow", "FollowUserByKeyword", StringEncoderDecoder.Encode(txtFollowUserUpload.Text));

                            if (!string.IsNullOrEmpty(txtFollowByUsername_NoOfThreads.Text) && checkNo.IsMatch(txtFollowByUsername_NoOfThreads.Text))
                            {
                                threads = Convert.ToInt32(txtFollowByUsername_NoOfThreads.Text);
                            }

                            if (threads > maxThread)
                            {
                                threads = 25;
                            }

                            GlobusLogHelper.log.Info(" => [ Process Starting ] ");

                            objFollowByUsernameManager.NoOfThreadsFollowByUsername = threads;

                            Thread FollowUsernameThread = new Thread(objFollowByUsernameManager.StartFollowByUsername);
                            FollowUsernameThread.Start();
                        }

                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
                else
                {
                    GlobusLogHelper.log.Info("Please Load Accounts !");
                    GlobusLogHelper.log.Debug("Please Load Accounts !");
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
        }
예제 #12
0
        public void Reply(ref Globussoft.GlobusHttpHelper globusHttpHelper, string postAuthenticityToken, string tweetID, string tweetUserName, string screenName, string tweetMessage, string userName)
        {
            try
            {
                if (userName == UserName)
                {
                    string strpostAuthenticityToken = string.Empty;

                    string get_twitter_first = globusHttpHelper.getHtmlfromUrlIP(new Uri("https://twitter.com/"), IPAddress, IPPort, IPUsername, IPpassword, string.Empty, string.Empty);

                    if (!string.IsNullOrEmpty(get_twitter_first) && !string.IsNullOrWhiteSpace(get_twitter_first))
                    {
                        strpostAuthenticityToken = PostAuthenticityToken(get_twitter_first, "postAuthenticityToken");
                    }
                    //Reply
                    //string TweetId = tweetID;// "197682704844734464";
                    //string ReTweetData = "post_authenticity_token=" + postAuthenticityToken;
                    //string ReTweetPostUrl = "https://api.twitter.com/1/statuses/retweet/" + TweetId + ".json";
                    //string a6 = globusHttpHelper.postFormData(new Uri(ReTweetPostUrl), ReTweetData, "https://api.twitter.com/receiver.html", postAuthenticityToken, "XMLHttpRequest", "true", "");
                    if (!string.IsNullOrEmpty(tweetMessage) && !string.IsNullOrWhiteSpace(tweetMessage))
                    {
                        string TweetId        = tweetID;                                                                                                                                                                                                       //"197551187803906048";
                        string ReplyData      = "in_reply_to_status_id=" + TweetId + "&include_entities=true&status=" + screenName + " " + tweetUserName + " " + HttpUtility.UrlEncode(tweetMessage) + "&post_authenticity_token=" + strpostAuthenticityToken; //"in_reply_to_status_id=" + TweetId + "&include_entities=true&status=%40" + "screenname to reply to" + "+" + tweetMessage + "&post_authenticity_token=" + postAuthenticityToken;
                        string res_Post_Reply = globusHttpHelper.postFormData(new Uri("https://api.twitter.com/1/statuses/update.json"), ReplyData, "https://api.twitter.com/receiver.html", postAuthenticityToken, "XMLHttpRequest", "true", "");

                        //status = "posted";
                        Log("[ " + DateTime.Now + " ] => [ Message Posted Sucessfully Where Status Id = " + tweetID + " With User Name : " + userName + " ]");

                        obj_clsDB_ReplyInterface.DeleteRecordsAfterReplyFromtb_ReplyCampaign(StringEncoderDecoder.Encode(tweetID), StringEncoderDecoder.Encode(userName));
                    }
                    else
                    {
                        Log("[ " + DateTime.Now + " ] => [ Message Couldn't Post  Sucessfully .Since Message Is Empty Where Status Id = " + tweetID + " With User Name : " + userName + " ]");
                    }
                }
            }
            catch (Exception ex)
            {
                //status = "not posted";
                Log("[ " + DateTime.Now + " ] => [ Method>>  Reply  --- class>>  Tweeter.cs : Reply Exception With User Name : " + UserName + "    " + ex.Message + " ]");
                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> Reply() --> " + ex.Message, Globals.Path_TweetingErroLog);
                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine("Error --> Reply() --> " + ex.Message, Globals.Path_TwtErrorLogs);
            }
        }
예제 #13
0
        public DataSet SelectTweetAndReplyFromtb_ReplyCampaign(string statusId, string UserName)
        {
            DataSet ds = new DataSet();

            try
            {
                string query = "Select distinct TweetText, Reply, TweetDateTime, ReplyDateTime from tb_ReplyCampaign where StatusId='" + StringEncoderDecoder.Encode(statusId) + "' and UserName='******' and Status='0'";
                ds = DataBaseHandler.SelectQuery(query, "tb_ReplyCampaign");
            }
            catch
            {
            }
            return(ds);
        }
예제 #14
0
        public void startAddUserToBoard()
        {
            try
            {
                if (PDGlobals.listAccounts.Count > 0)
                {
                    try
                    {
                        if (objAddUsersToBoardManager.rdbSingleUserAddUserToBoard == true || objAddUsersToBoardManager.rdbMultipleUserAddUserToBoard == true)
                        {
                            if (objAddUsersToBoardManager.rdbSingleUserAddUserToBoard == true)
                            {
                                try
                                {
                                    if (string.IsNullOrEmpty(txtBoardName.Text)) // && string.IsNullOrEmpty(objUserControl_SingleUserEmailOrUsername_AddUserToBoard.txtEmailorUsername_SingleUser_AddUserToBoard.Text))
                                    {
                                        GlobusLogHelper.log.Info("Please Enter BoardName ");
                                        ModernDialog.ShowMessage("Please Enter BoardName ", "Please Enter BoardName ", MessageBoxButton.OK);
                                        return;
                                    }
                                    else
                                    {
                                        if (!string.IsNullOrEmpty(txtBoardName.Text))
                                        {
                                            objAddUsersToBoardManager.BoardName = txtBoardName.Text.Trim();
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }//end of single User
                            if (objAddUsersToBoardManager.rdbMultipleUserAddUserToBoard == true)
                            {
                                try
                                {
                                    if (!string.IsNullOrEmpty(txtBoardName.Text))
                                    {
                                        objAddUsersToBoardManager.BoardName = txtBoardName.Text.Trim();
                                    }
                                    else
                                    {
                                        GlobusLogHelper.log.Info("Please Enter Board Name");
                                        ModernDialog.ShowMessage("Please Enter Board Name", "Enter Board Name", MessageBoxButton.OK);
                                        return;
                                    }
                                    if (string.IsNullOrEmpty(txtEmailOrUserNames.Text))
                                    {
                                        GlobusLogHelper.log.Info("Please Upload Email or UserName");
                                        ModernDialog.ShowMessage("Please Upload Email or UserName", "Upload Email or UserName", MessageBoxButton.OK);
                                        return;
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }//end of Multiple user
                        }
                        else
                        {
                            GlobusLogHelper.log.Info("Please Select Use Single User or Use Multiple User");
                            ModernDialog.ShowMessage("Please Select Use Single User or Use Multiple User", "Select Use Single User or Use Multiple User", MessageBoxButton.OK);
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }

                    //objAddUsersToBoardManager.BoardName = txtBoardName.Text.Trim();

                    objAddUsersToBoardManager.isStopAddUserToBoard = false;
                    objAddUsersToBoardManager.lstThreadsAddUserToBoard.Clear();
                    if (objAddUsersToBoardManager._IsfevoriteAddUserToBoard)
                    {
                        objAddUsersToBoardManager._IsfevoriteAddUserToBoard = false;
                    }

                    Regex checkNo = new Regex("^[0-9]*$");

                    int processorCount = objUtils.GetProcessor();

                    int threads = 25;

                    int maxThread = 25 * processorCount;

                    try
                    {
                        try
                        {
                            objAddUsersToBoardManager.minDelayAddUserToBoard    = Convert.ToInt32(txtUserBoard_DelayMin.Text);
                            objAddUsersToBoardManager.maxDelayAddUserToBoard    = Convert.ToInt32(txtUserBoard_DelayMax.Text);
                            objAddUsersToBoardManager.NoOfThreadsAddUserToBoard = Convert.ToInt32(txtUserBoard_NoOfThreads.Text);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Info("Enter in Correct Format");
                            return;
                        }

                        if (!string.IsNullOrEmpty(txtUserBoard_NoOfThreads.Text) && checkNo.IsMatch(txtUserBoard_NoOfThreads.Text))
                        {
                            threads = Convert.ToInt32(txtUserBoard_NoOfThreads.Text);
                        }

                        if (threads > maxThread)
                        {
                            threads = 25;
                        }
                        objAddUsersToBoardManager.NoOfThreadsAddUserToBoard = threads;

                        clsSettingDB Database = new clsSettingDB();
                        Database.UpdateSettingData("UserToBoard", "UserToBoard", StringEncoderDecoder.Encode(txtEmailOrUserNames.Text));

                        GlobusLogHelper.log.Info(" => [ Process Starting ] ");

                        Thread AddUserToBoardThread = new Thread(objAddUsersToBoardManager.StartAddUsersToBoard);
                        AddUserToBoardThread.Start();
                    }

                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
                else
                {
                    GlobusLogHelper.log.Info("Please Load Accounts !");
                    GlobusLogHelper.log.Debug("Please Load Accounts !");
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
        }
예제 #15
0
        public void GetScrapTweetAndReply(ref Globussoft.GlobusHttpHelper globusHttpHelper, ref string userId, ref string userName, ref string Screen_name, ref string postAuthenticityToken)
        {
            try
            {
                Log("[ " + DateTime.Now + " ] => [ Starting ScrapTweetAndReply.............With User Name : " + UserName + " ]");

                string pageSource = globusHttpHelper.getHtmlfromUrl(new Uri("https://twitter.com/" + Screen_name), "", "");

                List <string> lstStatusId = GetstatusId(pageSource, globusHttpHelper, ref Screen_name);

                if (lstStatusId.Count > 0)
                {
                    try
                    {
                        int    lastIndex = lstStatusId.Count - 1;
                        string max_Id    = lstStatusId[lastIndex];

                        List <string> lstAjaxStatusId = GetStatusIdThroughAjax(ref globusHttpHelper, Screen_name, max_Id);

                        lstStatusId.AddRange(lstAjaxStatusId);

                        lstStatusId = lstStatusId.Distinct().ToList();
                    }
                    catch
                    {
                    }
                }

                Log("[ " + DateTime.Now + " ] => [ Total StatusId = " + lstStatusId.Count + " With User Name : " + UserName + " ]");

                int counter = 0;

                int countDataBeforeSaving = 0;
                try
                {
                    DataSet ds = obj_clsDB_ReplyInterface.SelectFromtb_ReplyCampaign(StringEncoderDecoder.Encode(UserName));
                    countDataBeforeSaving = ds.Tables[0].Rows.Count;
                }
                catch
                {
                }

                foreach (string item in lstStatusId)
                {
                    try
                    {
                        string url = "https://twitter.com/" + Screen_name + "/status/" + item;

                        string pageSourceOfstatusId = globusHttpHelper.getHtmlfromUrl(new Uri(url), "", "");

                        List <string> lstTweet = GetTweet(globusHttpHelper, pageSourceOfstatusId);

                        List <string> lstTweetUserName = GetTweetUserName(globusHttpHelper, pageSourceOfstatusId);

                        List <string> lstTweetUserId = GetTweetUserId(globusHttpHelper, pageSourceOfstatusId);

                        List <string> lstTweetTime = GetTweetTime(globusHttpHelper, pageSourceOfstatusId);

                        List <string> lstReply = GetReply(globusHttpHelper, pageSourceOfstatusId);

                        List <string> lstReplyUserId = GetReplyUserId(globusHttpHelper, pageSourceOfstatusId);
                        // lstReplyUserId = lstReplyUserId.Distinct().ToList();

                        List <string> lstReplyUserName = GetReplyUserName(globusHttpHelper, pageSourceOfstatusId);

                        List <string> lstReplyTime = GetReplyTime(globusHttpHelper, pageSourceOfstatusId);

                        int index = 0;
                        foreach (string ReplyUserIditem in lstReplyUserId)
                        {
                            try
                            {
                                #region Variable
                                string statusId = string.Empty;
                                string strPostAuthenticityToken = string.Empty;
                                string UserId        = string.Empty;
                                string screenName    = string.Empty;
                                string tweet         = string.Empty;
                                string tweetUserId   = string.Empty;
                                string tweetUserName = string.Empty;
                                string tweetTime     = string.Empty;
                                string reply         = string.Empty;
                                string replyUserId   = string.Empty;
                                string replyUserName = string.Empty;
                                string replyTime     = string.Empty;
                                #endregion

                                if (!string.IsNullOrEmpty(ReplyUserIditem) && !string.IsNullOrWhiteSpace(ReplyUserIditem))
                                {
                                    replyUserId = ReplyUserIditem;

                                    foreach (string Tweetitem in lstTweet)
                                    {
                                        try
                                        {
                                            if (!string.IsNullOrEmpty(Tweetitem) && !string.IsNullOrWhiteSpace(Tweetitem))
                                            {
                                                tweet = Tweetitem;
                                                break;
                                            }
                                        }
                                        catch
                                        {
                                        }
                                    }

                                    foreach (string TweetUserNameitem in lstTweetUserName)
                                    {
                                        try
                                        {
                                            if (!string.IsNullOrEmpty(TweetUserNameitem) && !string.IsNullOrWhiteSpace(TweetUserNameitem))
                                            {
                                                tweetUserName = TweetUserNameitem;
                                                break;
                                            }
                                        }
                                        catch
                                        {
                                        }
                                    }

                                    foreach (string TweetUserIditem in lstTweetUserId)
                                    {
                                        try
                                        {
                                            if (!string.IsNullOrEmpty(TweetUserIditem) && !string.IsNullOrWhiteSpace(TweetUserIditem))
                                            {
                                                tweetUserId = TweetUserIditem;
                                                break;
                                            }
                                        }
                                        catch
                                        {
                                        }
                                    }

                                    foreach (string lstTweetTimeitem in lstTweetTime)
                                    {
                                        try
                                        {
                                            if (!string.IsNullOrEmpty(lstTweetTimeitem) && !string.IsNullOrWhiteSpace(lstTweetTimeitem))
                                            {
                                                tweetTime = lstTweetTimeitem;
                                                break;
                                            }
                                        }
                                        catch
                                        {
                                        }
                                    }

                                    try
                                    {
                                        reply = lstReply[index];
                                    }
                                    catch
                                    {
                                    }

                                    try
                                    {
                                        replyUserName = lstReplyUserName[index];
                                    }
                                    catch
                                    {
                                    }

                                    try
                                    {
                                        replyTime = lstReplyTime[index];
                                    }
                                    catch
                                    {
                                    }

                                    index++;


                                    statusId = item;

                                    strPostAuthenticityToken = postAuthenticityToken;

                                    UserId = userId;

                                    UserName = userName;

                                    screenName = Screen_Name;

                                    if (!string.IsNullOrEmpty(statusId) && !string.IsNullOrWhiteSpace(statusId) && !string.IsNullOrEmpty(UserName) && !string.IsNullOrWhiteSpace(UserName) && !string.IsNullOrEmpty(replyUserId) && !string.IsNullOrWhiteSpace(replyUserId) && !string.IsNullOrEmpty(replyUserName) && !string.IsNullOrWhiteSpace(replyUserName) && !string.IsNullOrEmpty(reply) && !string.IsNullOrWhiteSpace(reply) && !string.IsNullOrEmpty(strPostAuthenticityToken) && !string.IsNullOrWhiteSpace(strPostAuthenticityToken)) //!string.IsNullOrEmpty(UserId) && !string.IsNullOrWhiteSpace(UserId) &&
                                    {
                                        try
                                        {
                                            DataSet ds = obj_clsDB_ReplyInterface.SelectStatusIdUserNameTweetAndReplyFromtb_ReplyCampaign(StringEncoderDecoder.Encode(statusId), StringEncoderDecoder.Encode(UserName), StringEncoderDecoder.Encode(tweet), StringEncoderDecoder.Encode(reply));

                                            if (ds.Tables[0].Rows.Count < 1)
                                            {
                                                obj_clsDB_ReplyInterface.InserIntotb_ReplyCampaign(StringEncoderDecoder.Encode(statusId), StringEncoderDecoder.Encode(strPostAuthenticityToken), StringEncoderDecoder.Encode(UserId), StringEncoderDecoder.Encode(userName), StringEncoderDecoder.Encode(screenName), StringEncoderDecoder.Encode(tweetUserId), StringEncoderDecoder.Encode(tweetUserName), StringEncoderDecoder.Encode(replyUserId), StringEncoderDecoder.Encode(replyUserName), StringEncoderDecoder.Encode(tweet), StringEncoderDecoder.Encode(tweetTime), StringEncoderDecoder.Encode(reply), StringEncoderDecoder.Encode(replyTime), StringEncoderDecoder.Encode('0'.ToString()));

                                                counter++;
                                                Log("[ " + DateTime.Now + " ] => [ " + counter + " Record Saved In Data Base With User Name : " + UserName + " ]");
                                            }
                                        }
                                        catch
                                        {
                                        }
                                    }
                                }
                            }
                            catch
                            {
                            }
                        }
                    }
                    catch
                    {
                    }
                }

                int countDataAfterSaving = 0;
                try
                {
                    DataSet ds = obj_clsDB_ReplyInterface.SelectFromtb_ReplyCampaign(StringEncoderDecoder.Encode(UserName));
                    countDataAfterSaving = ds.Tables[0].Rows.Count;



                    if (countDataBeforeSaving == countDataAfterSaving)
                    {
                        Log("[ " + DateTime.Now + " ] => [ No New Reply With User Name : " + userName + " ] ");
                    }
                }
                catch
                {
                }

                Log("[ " + DateTime.Now + " ] => [ PROCESS COMPLTED With User Name : " + userName + " ]");
                Log("------------------------------------------------------------------------------------------------------------------------------------------");
            }
            catch
            {
            }
        }
예제 #16
0
        private void BindData()
        {
            try
            {
                DataTable datatable = CreateTable();


                DataSet   ds1 = obj_clsDB_ReplyInterface.SelectDistinctStatusIdFromtb_MentionReplyCampaign();
                DataTable dt1 = ds1.Tables["tb_MentionReplyCampaign"];

                if (dt1.Rows.Count > 0)
                {
                    foreach (DataRow item in dt1.Rows)
                    {
                        try
                        {
                            DataSet   ds2 = obj_clsDB_ReplyInterface.SelectDistinctAllFromtb_MentionReplyCampaign();
                            DataTable dt2 = ds2.Tables["tb_MentionReplyCampaign"];

                            if (dt2.Rows.Count > 0)
                            {
                                foreach (DataRow item1 in dt2.Rows)
                                {
                                    try
                                    {
                                        DataRow dr = datatable.NewRow();

                                        dr["StatusId"] = StringEncoderDecoder.Decode(item1["StatusId"].ToString());
                                        dr["PostAuthenticityToken"] = StringEncoderDecoder.Decode(item1["PostAuthenticityToken"].ToString());
                                        dr["UserId"]       = StringEncoderDecoder.Decode(item1["UserId"].ToString());
                                        dr["FakeAccounts"] = StringEncoderDecoder.Decode(item1["UserName"].ToString());
                                        dr["FakeUserName"] = StringEncoderDecoder.Decode(item1["ScreenName"].ToString());
                                        dr["TweetUserId"]  = StringEncoderDecoder.Decode(item1["TweetUserId"].ToString());
                                        //dr["TweetUserName"] = StringEncoderDecoder.Decode(item1["TweetUserName"].ToString());
                                        dr["ReplyUserId"] = StringEncoderDecoder.Decode(item1["ReplyUserId"].ToString());
                                        dr["TweetText"]   = StringEncoderDecoder.Decode(item1["TweetText"].ToString());
                                        dr["Reply"]       = StringEncoderDecoder.Decode(item1["Reply"].ToString());
                                        //dr["Status"] = StringEncoderDecoder.Decode(item["Status"].ToString());

                                        if (("@" + item1["ScreenName"].ToString() != item1["ReplyUserName"].ToString()) && !string.IsNullOrEmpty(item1["ReplyUserName"].ToString()))
                                        {
                                            dr["RealUser"] = StringEncoderDecoder.Decode(item1["ReplyUserName"].ToString());
                                        }
                                        else
                                        {
                                            if (("@" + item1["ScreenName"].ToString() != item1["TweetUserName"].ToString()) && !string.IsNullOrEmpty(item1["TweetUserName"].ToString()))
                                            {
                                                dr["RealUser"] = StringEncoderDecoder.Decode(item1["TweetUserName"].ToString());
                                            }
                                        }

                                        if (!string.IsNullOrEmpty(dr["RealUser"].ToString()))
                                        {
                                            datatable.Rows.Add(dr);
                                        }
                                    }
                                    catch
                                    {
                                    }
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                }
                //DataSet ds = obj_clsDB_ReplyInterface.SelectDistinctAllFromtb_MentionReplyCampaign();
                //DataTable dt = ds.Tables["tb_MentionReplyCampaign"];

                //if (dt.Rows.Count > 0)
                //{
                //    foreach (DataRow item in dt.Rows)
                //    {
                //        try
                //        {
                //            if (("@" + item["ScreenName"].ToString() != item["ReplyUserName"].ToString() && !string.IsNullOrEmpty(item["ReplyUserName"].ToString())) || ("@" + item["ScreenName"].ToString() != item["TweetUserName"].ToString() && !string.IsNullOrEmpty(item["TweetUserName"].ToString())))
                //            {

                //                DataRow dr = datatable.NewRow();

                //                dr["StatusId"] = StringEncoderDecoder.Decode(item["StatusId"].ToString());
                //                dr["PostAuthenticityToken"] = StringEncoderDecoder.Decode(item["PostAuthenticityToken"].ToString());
                //                dr["UserId"] = StringEncoderDecoder.Decode(item["UserId"].ToString());
                //                dr["FakeAccounts"] = StringEncoderDecoder.Decode(item["UserName"].ToString());
                //                dr["ScreenName"] = StringEncoderDecoder.Decode(item["ScreenName"].ToString());
                //                dr["TweetUserId"] = StringEncoderDecoder.Decode(item["TweetUserId"].ToString());
                //                dr["FakeUserName"] = StringEncoderDecoder.Decode(item["TweetUserName"].ToString());
                //                dr["ReplyUserId"] = StringEncoderDecoder.Decode(item["ReplyUserId"].ToString());
                //                dr["RealUser"] = StringEncoderDecoder.Decode(item["ReplyUserName"].ToString());
                //                dr["TweetText"] = StringEncoderDecoder.Decode(item["TweetText"].ToString());
                //                dr["Reply"] = StringEncoderDecoder.Decode(item["Reply"].ToString());
                //                //dr["Status"] = StringEncoderDecoder.Decode(item["Status"].ToString());

                //                datatable.Rows.Add(dr);
                //            }


                //        }
                //        catch
                //        {
                //        }
                //    }

                //    if (datatable.Rows.Count > 0)
                //    {

                //    }

                //    else
                //    {
                //        AddToReplyInterface("There Is No New Tweet !");
                //    }


                //}
                //else
                //{
                //    AddToReplyInterface("There Is No Records In DataBase !");
                //}

                try
                {
                    grdReplyInterface.Invoke(new MethodInvoker(delegate
                    {
                        grdReplyInterface.DataSource = datatable;

                        //grdReplyInterface.Columns["UserName"].Visible = false;
                        grdReplyInterface.Columns["StatusId"].Visible = true;
                        grdReplyInterface.Columns["PostAuthenticityToken"].Visible = false;
                        grdReplyInterface.Columns["UserId"].Visible     = false;
                        grdReplyInterface.Columns["ScreenName"].Visible = false;
                        //grdReplyInterface.Columns["StatusId"].Visible = false;
                        grdReplyInterface.Columns["TweetUserId"].Visible = false;
                        //grdReplyInterface.Columns["TweetUserName"].Visible = false;
                        grdReplyInterface.Columns["ReplyUserId"].Visible = false;
                        //grdReplyInterface.Columns["ReplyUserName"].Visible = false;
                        grdReplyInterface.Columns["TweetText"].Visible = false;
                        grdReplyInterface.Columns["Reply"].Visible     = false;
                        grdReplyInterface.Columns["Status"].Visible    = false;

                        grdReplyInterface.Refresh();
                        grdReplyInterface.RefreshEdit();
                    }));

                    lstbMessages.Invoke(new MethodInvoker(delegate
                    {
                        lstbMessages.Items.Clear();
                    }));

                    txtEditMessage.Invoke(new MethodInvoker(delegate
                    {
                        txtEditMessage.Clear();
                    }));
                }
                catch
                {
                }
            }
            catch
            {
            }
        }
예제 #17
0
        private void btnReply_Click(object sender, EventArgs e)
        {
            try
            {
                if ((lstMessage.Count > 0) && (!string.IsNullOrEmpty(textBox1.Text)))
                {
                    objclsSettingDB.InsertOrUpdateSetting("MentionReplyInterface", "Message", StringEncoderDecoder.Encode(textBox1.Text));
                }

                if (!string.IsNullOrEmpty(txtEditMessage.Text) && !string.IsNullOrEmpty(txtEditMessage.Text))
                {
                    message = txtEditMessage.Text;
                }
                else
                {
                    MessageBox.Show("Please Enter The Message In Edit Message Box !");
                    return;
                }

                Thread Reply_Thread = new Thread(Reply);
                Reply_Thread.Start();
            }
            catch
            {
            }
        }
예제 #18
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                using (OpenFileDialog ofd = new OpenFileDialog())
                {
                    ofd.Filter           = "Text Files (*.txt)|*.txt";
                    ofd.InitialDirectory = Application.StartupPath;
                    if (ofd.ShowDialog() == DialogResult.OK)
                    {
                        textBox1.Text = ofd.FileName;
                        List <string> templist = GlobusFileHelper.ReadFiletoStringList(ofd.FileName);
                        templist = templist.Distinct().ToList();
                        ///Modified [1.0.0.3]
                        //lstMessage = new List<string>();

                        foreach (string item in templist)
                        {
                            //if (!lstMessage.Contains(item))
                            {
                                lstMessage.Add(item);
                            }
                        }

                        //Console.WriteLine(lstGrpKeywords.Count + " Group Keywords loaded");
                        AddToReplyInterfaceLog("[ " + DateTime.Now + " ] => [ " + lstMessage.Count + " Message Loaded ! ]");
                        //AddToGrpPages(lstGrpKeywords.Count + " Group Keywords loaded");

                        //Save the file

                        if ((lstMessage.Count > 0) && (!string.IsNullOrEmpty(textBox1.Text)))
                        {
                            try
                            {
                                objclsSettingDB.InsertOrUpdateSetting("MentionReplyInterface", "Message", StringEncoderDecoder.Encode(textBox1.Text));
                            }
                            catch
                            {
                            }
                        }
                    }
                }
                BindDataIntoDropDownList();
            }
            catch
            {
            }
        }
예제 #19
0
        public void startBoardCreation()
        {
            try
            {
                if (PDGlobals.listAccounts.Count > 0)
                {
                    try
                    {
                        if (objBoardsManager.rdbSingleUserBoards == true || objBoardsManager.rdbMultipleUserBoards == true)
                        {
                            if (objBoardsManager.rdbSingleUserBoards == true)
                            {
                                try
                                {
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Info("Error :" + ex.StackTrace);
                                }
                            }//end of single user
                            if (objBoardsManager.rdbMultipleUserBoards == true)
                            {
                                try
                                {
                                    if (string.IsNullOrEmpty(txtBoardUrl.Text))
                                    {
                                        GlobusLogHelper.log.Info("Please Enter Board Url");
                                        ModernDialog.ShowMessage("Please Enter Board Url", "Enter Board Url", MessageBoxButton.OK);
                                        return;
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Info("Error :" + ex.StackTrace);
                                }
                            }//end of multiple user
                        }
                        else
                        {
                            MessageBox.Show("Please Select Use Single User or Use Multiple User");
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }

                    clsSettingDB Database = new clsSettingDB();
                    // Database.UpdateSettingData("Board", "AddBoardUrl", StringEncoderDecoder.Encode(txtBoardName.Text));
                    Database.UpdateSettingData("Board", "AddBoardMessage", StringEncoderDecoder.Encode(txtMessage.Text));

                    objBoardsManager.isStopBoards = false;
                    objBoardsManager.lstThreadsBoards.Clear();
                    if (objBoardsManager._IsfevoriteBoards)
                    {
                        objBoardsManager._IsfevoriteBoards = false;
                    }

                    Regex checkNo = new Regex("^[0-9]*$");

                    int processorCount = objUtil.GetProcessor();

                    int threads = 25;

                    int maxThread = 25 * processorCount;

                    try
                    {
                        try
                        {
                            objBoardsManager.minDelayBoards    = Convert.ToInt32(txtBoard_DelayMin.Text);
                            objBoardsManager.maxDelayBoards    = Convert.ToInt32(txtBoard_DelayMax.Text);
                            objBoardsManager.NoOfThreadsBoards = Convert.ToInt32(txtBoard_NoOfThreads.Text);
                            objBoardsManager.MaxRePinCount     = Convert.ToInt32(txtNoOfPinRepin.Text);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Info("Enter in Correct Format");
                            return;
                        }

                        if (!string.IsNullOrEmpty(txtBoard_NoOfThreads.Text) && checkNo.IsMatch(txtBoard_NoOfThreads.Text))
                        {
                            threads = Convert.ToInt32(txtBoard_NoOfThreads.Text);
                        }

                        if (threads > maxThread)
                        {
                            threads = 25;
                        }
                        objBoardsManager.NoOfThreadsBoards = threads;

                        GlobusLogHelper.log.Info(" => [ Process Starting ] ");

                        Thread BoardsThread = new Thread(objBoardsManager.StartBoards);
                        BoardsThread.Start();
                    }

                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
                else
                {
                    GlobusLogHelper.log.Info("Please Load Accounts !");
                    GlobusLogHelper.log.Debug("Please Load Accounts !");
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
        }
예제 #20
0
        public void startFollowByKeyword()
        {
            try
            {
                if (PDGlobals.listAccounts.Count > 0)
                {
                    try
                    {
                        if (objFollowByKeywordManager.rdbSingleUserFollowByKeyword == true || objFollowByKeywordManager.rdbMultipleUserFollowByKeyword == true)
                        {
                            if (objFollowByKeywordManager.rdbSingleUserFollowByKeyword == true)
                            {
                                try
                                {
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }//end of single User
                            if (objFollowByKeywordManager.rdbMultipleUserFollowByKeyword == true)
                            {
                                try
                                {
                                    if (string.IsNullOrEmpty(txtKeywordUpload.Text))
                                    {
                                        GlobusLogHelper.log.Info("Please Upload Keyword ");
                                        ModernDialog.ShowMessage("Please Upload Comment Keyword", "Upload Keyword", MessageBoxButton.OK);
                                        return;
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }//end of Multiple user
                        }
                        else
                        {
                            GlobusLogHelper.log.Info("Please Select Use Single User or Use Multiple User");
                            ModernDialog.ShowMessage("Please Select Use Single User or Use Multiple User", "Select Use Single User or Use Multiple User", MessageBoxButton.OK);
                            return;
                        }

                        objFollowByKeywordManager.isStopFollowByKeyword = false;
                        objFollowByKeywordManager.lstThreadsFollowByKeyword.Clear();

                        if (objFollowByKeywordManager._IsfevoriteFollowByKeyword)
                        {
                            objFollowByKeywordManager._IsfevoriteFollowByKeyword = false;
                        }

                        Regex checkNo = new Regex("^[0-9]*$");

                        int processorCount = objUtils.GetProcessor();

                        int threads = 25;

                        int maxThread = 25 * processorCount;
                        try
                        {
                            try
                            {
                                objFollowByKeywordManager.minDelayFollowByKeyword      = Convert.ToInt32(txtFollowByKeyword_DelayMin.Text);
                                objFollowByKeywordManager.maxDelayFollowByKeyword      = Convert.ToInt32(txtFollowByKeyword_DelayMax.Text);
                                objFollowByKeywordManager.Nothread_FollowByKeyword     = Convert.ToInt32(txtFollowByKeyword_NoOfThreads.Text);
                                objFollowByKeywordManager.NoOfUserFollowByKeyword      = Convert.ToInt32(txtFollowPerDay.Text);
                                objFollowByKeywordManager.AccPerDayUserFollowByKeyword = Convert.ToInt32(txtBoxHours_FollowByKeyword.Text);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Info("Enter in Correct Format");
                                return;
                            }

                            QM.UpdateSettingData("Follow", "FollowUserByKeyword", StringEncoderDecoder.Encode(txtKeywordUpload.Text));
                            GlobusLogHelper.log.Info(" => [ Starting Follow Through Keyword ]");

                            if (!string.IsNullOrEmpty(txtFollowByKeyword_NoOfThreads.Text) && checkNo.IsMatch(txtFollowByKeyword_NoOfThreads.Text))
                            {
                                threads = Convert.ToInt32(txtFollowByKeyword_NoOfThreads.Text);
                            }

                            if (threads > maxThread)
                            {
                                threads = 25;
                            }

                            GlobusLogHelper.log.Info(" => [ Process Starting ] ");
                            objFollowByKeywordManager.NoOfThreadsFollowByKeyword = threads;

                            Thread FollowKeywordThread = new Thread(objFollowByKeywordManager.StartFollowKeyword);
                            FollowKeywordThread.Start();
                        }

                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
                else
                {
                    GlobusLogHelper.log.Info("Please Load Accounts !");
                    GlobusLogHelper.log.Debug("Please Load Accounts !");
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
        }
        public void startEditDescription()
        {
            try
            {
                if (PDGlobals.listAccounts.Count > 0)
                {
                    try
                    {
                        if (objEditPinDiscriptionManager.rdbSingleUserEditPinDisc == true || objEditPinDiscriptionManager.rdbMultipleUserEditPinDisc == true)
                        {
                            if (objEditPinDiscriptionManager.rdbSingleUserEditPinDisc == true)
                            {
                                try
                                {
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }//end of single User
                            if (objEditPinDiscriptionManager.rdbMultipleUserEditPinDisc == true)
                            {
                                try
                                {
                                    if (string.IsNullOrEmpty(txtPinDescription.Text))
                                    {
                                        GlobusLogHelper.log.Info("Please Upload Description");
                                        ModernDialog.ShowMessage("Please Upload Description", "Upload Description", MessageBoxButton.OK);
                                        return;
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }//end of multiple user
                        }
                        else
                        {
                            GlobusLogHelper.log.Info("Please Select Use Single User or Use Multiple User");
                            ModernDialog.ShowMessage("Please Select Use Single User or Use Multiple User", "Select Use Single User or Use Multiple User", MessageBoxButton.OK);
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                    objEditPinDiscriptionManager.isStopEditPinDisc = false;
                    objEditPinDiscriptionManager.lstThreadsEditPinDisc.Clear();

                    if (objEditPinDiscriptionManager._IsfevoriteEditPinDes)
                    {
                        objEditPinDiscriptionManager._IsfevoriteEditPinDes = false;
                    }

                    Regex checkNo = new Regex("^[0-9]*$");

                    int processorCount = objUtils.GetProcessor();

                    int threads = 25;

                    int maxThread = 25 * processorCount;
                    try
                    {
                        try
                        {
                            objEditPinDiscriptionManager.minDelayEditPinDisc  = Convert.ToInt32(txtEditPinDescription_DelayMin.Text);
                            objEditPinDiscriptionManager.maxDelayEditPinDisc  = Convert.ToInt32(txtEditPinDescription_DelayMax.Text);
                            objEditPinDiscriptionManager.Nothread_EditPinDisc = Convert.ToInt32(txtEditPinDescription_NoOfThreads.Text);
                            objEditPinDiscriptionManager.NoOfPagesEditPinDisc = Convert.ToInt32(txtNoOfPages_EditPinDisc.Text);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Info("Enter in Correct Format");
                            return;
                        }


                        if (ClGlobul.CommentNicheMessageList.Count > 0)
                        {
                            clsSettingDB Database = new clsSettingDB();
                            Database.UpdateSettingData("PinDescription", "PinDescriptionMessage", StringEncoderDecoder.Encode(txtPinDescription.Text));
                            GlobusLogHelper.log.Info(" => [ Start Edit Description ]");
                            ClGlobul.lstPins.Clear();
                        }
                        if (!string.IsNullOrEmpty(txtEditPinDescription_NoOfThreads.Text) && checkNo.IsMatch(txtEditPinDescription_NoOfThreads.Text))
                        {
                            threads = Convert.ToInt32(txtEditPinDescription_NoOfThreads.Text);
                        }

                        if (threads > maxThread)
                        {
                            threads = 25;
                        }
                        GlobusLogHelper.log.Info(" => [ Process Starting ] ");
                        objEditPinDiscriptionManager.NoOfThreadsEditPinDisc = threads;

                        Thread EditPinDiscThread = new Thread(objEditPinDiscriptionManager.StartEditPinDisc);
                        EditPinDiscThread.Start();
                    }

                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
                else
                {
                    GlobusLogHelper.log.Info("Please Load Accounts !");
                    GlobusLogHelper.log.Debug("Please Load Accounts !");
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
        }
예제 #22
0
        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
            {
            }
        }