コード例 #1
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
            {
            }
        }
コード例 #2
0
ファイル: FrmCaptchaLogin.cs プロジェクト: ondrocks/inboard
        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
            {
            }
        }
コード例 #3
0
        public void StartActionMultithreadCommentByKeyword(ref PinInterestUser objPinUser, List <string> UserCount_CommentByKeyword)
        {
            try
            {
                try
                {
                    lstThreadsCommentByKeyword.Add(Thread.CurrentThread);
                    lstThreadsCommentByKeyword.Distinct().ToList();
                    Thread.CurrentThread.IsBackground = true;
                }
                catch (Exception ex)
                { };
                int      counter   = 0;
                string[] arrayItem = new string[100];

                foreach (string newItem in UserCount_CommentByKeyword)
                {
                    try
                    {
                        arrayItem = Regex.Split(newItem, "::");
                        if (arrayItem.Length == 3 && arrayItem[0] == objPinUser.Niches)
                        {
                            if (arrayItem.Length == 3)
                            {
                                string[] Keywordarrray = Regex.Split(arrayItem[1], ",");
                                foreach (string KeywordsItem in Keywordarrray)
                                {
                                    lock (this)
                                    {
                                        try
                                        {
                                            Keyword = KeywordsItem + "::" + arrayItem[2].ToString();
                                            lstCommnet.Add(Keyword);
                                            List <string> LstPins = new List <string>();
                                            LstPins = KeywordPins_New(KeywordsItem, MaxCommentByKeyword, ref objPinUser);
                                            //PinterestComments Comments = new PinterestComments();
                                            keyword = Utils.Utils.getBetween(KeywordsItem, "", "::");
                                            GlobusLogHelper.log.Info(" => [ Finding Pins On Keyword : " + KeywordsItem + " For " + objPinUser.Username + " ]");
                                            GlobusLogHelper.log.Info(" => [ " + LstPins.Count + " Pins On Keyword :" + KeywordsItem + " For " + objPinUser.Username + " ]");
                                            List <string> lstofPin = new List <string>();
                                            lstofPin = LstPins.Distinct().ToList();
                                            string[] lstCommnet_strlist = Regex.Split(newItem, "::");//lstCommnet.ToArray();
                                            foreach (string pin in lstofPin)
                                            {
                                                try
                                                {
                                                    clsSettingDB Db   = new clsSettingDB();
                                                    string       user = PinterestPins.getUserNameFromPinId(pin, ref objPinUser);

                                                    if (counter >= MaxCommentByKeyword)
                                                    {
                                                        break;
                                                    }
                                                    else
                                                    {
                                                        #region Commented
                                                        //comment = lstCommnet[RandomNumberGenerator.GenerateRandom(0, lstCommnet.Count)];

                                                        //if (comment.Contains("::"))
                                                        //{
                                                        //    comment = Regex.Split(comment, "::")[1];
                                                        //}
                                                        //else if (comment.Contains(":"))
                                                        //{
                                                        //    if (comment.Contains("http:"))
                                                        //    {
                                                        //        comment = comment.Split(':')[comment.Split(':').Count() - 1];
                                                        //        comment = "http:" + comment.Split(':')[comment.Split(':').Count() - 1];
                                                        //    }
                                                        //    else
                                                        //    {
                                                        //        comment = comment.Split(':')[comment.Split(':').Count() - 1];
                                                        //    }
                                                        //}
                                                        #endregion
                                                        #region
                                                        try
                                                        {
                                                            DataSet   DS = QM.selectCommentedPinDetails(objPinUser.Username, pin);
                                                            DataTable Dt = DS.Tables[0];

                                                            string   dateTime         = Dt.Rows[Dt.Rows.Count - 1].ItemArray[3].ToString();
                                                            DateTime previousDateTime = Convert.ToDateTime(dateTime);
                                                            DateTime currentDate      = DateTime.Today;
                                                            TimeSpan dt_Difference    = currentDate.Subtract(previousDateTime);
                                                            double   dt_Difference1   = dt_Difference.Days;
                                                            if (dt_Difference1 < 30)
                                                            {
                                                                continue;
                                                            }
                                                        }
                                                        catch (Exception Ex)
                                                        {
                                                            //CommentAddToLogger("Error ==> " + Ex.StackTrace);
                                                        }

                                                        #endregion
                                                        Thread.Sleep(1 * 1000);
                                                        bool IsCommented = objCommentManagers.Comment_new(ref objPinUser, pin, lstCommnet_strlist[2]);
                                                        if (IsCommented)
                                                        {
                                                            #region AccountReport

                                                            string module = "CommentByKeyword";
                                                            string status = "Commented";
                                                            Qm.insertAccRePort(objPinUser.Username, module, "https://www.pinterest.com/pin/" + pin, "", "", lstCommnet_strlist[2], KeywordsItem, "", status, "", "", DateTime.Now);
                                                            objCommentByKeywordDelegate();

                                                            #endregion
                                                            counter++;
                                                            GlobusLogHelper.log.Info(" => [ Commneted on Pin : " + pin + " From " + objPinUser.Username + " ]");
                                                            clsSettingDB Databse = new clsSettingDB();
                                                            Databse.insertMessageDate(objPinUser.Username, user.Replace("/", ""), pin, KeywordsItem, comment);
                                                            try
                                                            {
                                                                QueryManager.insertCommentedPinDetails(objPinUser.Username, pin, DateTime.Now.ToString());
                                                            }
                                                            catch { };

                                                            try
                                                            {
                                                                string CSV_Header = "Date" + "," + "UserName" + "," + "Comment" + "," + "Keyword" + "," + "Niche" + "," + "PinUrl";
                                                                string CSV_Data   = System.DateTime.Now.ToString() + "," + objPinUser.Username + "," + comment + "," + KeywordsItem + "," + objPinUser.Niches + "," + "https://www.pinterest.com/pin/" + pin;
                                                                string path       = PDGlobals.FolderCreation(PDGlobals.Pindominator_Folder_Path, "Comment");
                                                                PDGlobals.ExportDataCSVFile(CSV_Header, CSV_Data, path + "\\CommentBykeyword.csv");
                                                            }
                                                            catch (Exception ex)
                                                            {
                                                            }
                                                        }
                                                        else
                                                        {
                                                            GlobusLogHelper.log.Info(" => [ Not Commneted on Pin : " + pin + " From " + objPinUser.Username + " ]");
                                                        }

                                                        //if (rdbDivideGivenByUserCommentByKeyword == true)
                                                        //{
                                                        //    CountGivenByUserCommentByKeyword--;
                                                        //    if (CountGivenByUserCommentByKeyword < 0)
                                                        //    {
                                                        //        break;
                                                        //    }
                                                        //}

                                                        int delay = RandomNumberGenerator.GenerateRandom(minDelayCommentByKeyword, maxDelayCommentByKeyword);
                                                        GlobusLogHelper.log.Info(" => [ Delay For " + delay + " Seconds ]");
                                                        Thread.Sleep(delay * 1000);
                                                    }
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error(" Error : 3.4" + ex.StackTrace);
                                                }
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error(" Error : 3.4" + ex.StackTrace);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error(" Error : 3.4" + ex.StackTrace);
                    }

                    #region Comment
                    // }
                    //string[] lstCommnet_strlist = lstCommnet.ToArray();
                    //if (objPinUser.Niches == arrayItem[0])
                    //{
                    //    foreach (string FindKeyword in lstCommnet_strlist)
                    //    {

                    //        try
                    //        {
                    //            List<string> LstPins = KeywordPins_New(FindKeyword, MaxCommentByKeyword, ref objPinUser);
                    //            //PinterestComments Comments = new PinterestComments();
                    //            keyword = Utils.Utils.getBetween(FindKeyword, "", "::");
                    //            GlobusLogHelper.log.Info(" => [ Finding Pins On Keyword : " + FindKeyword + " For " + objPinUser.Username + " ]");
                    //            GlobusLogHelper.log.Info(" => [ " + LstPins.Count + " Pins On Keyword :" + FindKeyword + " For " + objPinUser.Username + " ]");
                    //            List<string> lstofPin = LstPins;
                    //            foreach (string pin in lstofPin)
                    //            {
                    //                clsSettingDB Db = new clsSettingDB();
                    //                string user = PinterestPins.getUserNameFromPinId(pin, ref objPinUser);

                    //                if (counter >= MaxCommentByKeyword)
                    //                {
                    //                    GlobusLogHelper.log.Info(" => [ PROCESS COMPLETED " + " For " + objPinUser.Username + " ]");
                    //                    GlobusLogHelper.log.Info("---------------------------------------------------------------------------------------------------------------------------");
                    //                    break;
                    //                }
                    //                else
                    //                {
                    //                    comment = lstCommnet[RandomNumberGenerator.GenerateRandom(0, lstCommnet.Count)];
                    //                    if (comment.Contains("::"))
                    //                    {
                    //                        comment = Regex.Split(comment, "::")[1];
                    //                    }
                    //                    else if (comment.Contains(":"))
                    //                    {
                    //                        if (comment.Contains("http:"))
                    //                        {
                    //                            comment = comment.Split(':')[comment.Split(':').Count() - 1];
                    //                            comment = "http:" + comment.Split(':')[comment.Split(':').Count() - 1];
                    //                        }
                    //                        else
                    //                        {
                    //                            comment = comment.Split(':')[comment.Split(':').Count() - 1];
                    //                        }
                    //                    }

                    //                    #region
                    //                    try
                    //                    {
                    //                        DataSet DS = QM.selectCommentedPinDetails(objPinUser.Username, pin);
                    //                        DataTable Dt = DS.Tables[0];

                    //                        string dateTime = Dt.Rows[Dt.Rows.Count - 1].ItemArray[3].ToString();
                    //                        DateTime previousDateTime = Convert.ToDateTime(dateTime);
                    //                        DateTime currentDate = DateTime.Today;
                    //                        TimeSpan dt_Difference = currentDate.Subtract(previousDateTime);
                    //                        double dt_Difference1 = dt_Difference.Days;
                    //                        if (dt_Difference1 < 30)
                    //                        {
                    //                            continue;
                    //                        }

                    //                    }
                    //                    catch (Exception Ex)
                    //                    {
                    //                        //CommentAddToLogger("Error ==> " + Ex.StackTrace);
                    //                    }

                    //                    #endregion

                    //                    bool IsCommented = objCommentManagers.Comment_new(ref objPinUser, pin, comment);
                    //                    if (IsCommented)
                    //                    {
                    //                        #region AccountReport

                    //                        string module = "CommentByKeyword";
                    //                        string status = "Commented";
                    //                        Qm.insertAccRePort(objPinUser.Username, module, pin, "", "", comment, keyword, "", status, "", "", DateTime.Now);
                    //                        objCommentByKeywordDelegate();

                    //                        #endregion

                    //                        GlobusLogHelper.log.Info(" => [ Commneted on Pin : " + pin + " From " + objPinUser.Username + " ]");
                    //                        clsSettingDB Databse = new clsSettingDB();
                    //                        Databse.insertMessageDate(objPinUser.Username, user.Replace("/", ""), pin, keyword, comment);
                    //                        try
                    //                        {
                    //                            QueryManager.insertCommentedPinDetails(objPinUser.Username, pin, DateTime.Now.ToString());
                    //                        }
                    //                        catch { };
                    //                        counter++;

                    //                        try
                    //                        {
                    //                            string CSV_Header = "Date" + "," + "UserName" + "," + "Comment" + "," + "Keyword" + "," + "Niche" + "," + "PinUrl";
                    //                            string CSV_Data = System.DateTime.Now.ToString() + "," + objPinUser.Username + "," + comment + "," + keyword + "," + objPinUser.Niches + "," + "https://www.pinterest.com/pin/" + pin;
                    //                            string path = PDGlobals.FolderCreation(PDGlobals.Pindominator_Folder_Path, "Comment");
                    //                            PDGlobals.ExportDataCSVFile(CSV_Header, CSV_Data, path + "\\CommentBykeyword.csv");
                    //                        }
                    //                        catch (Exception ex)
                    //                        {

                    //                        }
                    //                    }
                    //                    else
                    //                    {
                    //                        GlobusLogHelper.log.Info(" => [ Not Commneted on Pin : " + pin + " From " + objPinUser.Username + " ]");
                    //                    }

                    //                    //if (rdbDivideGivenByUserCommentByKeyword == true)
                    //                    //{
                    //                    //    CountGivenByUserCommentByKeyword--;
                    //                    //    if (CountGivenByUserCommentByKeyword < 0)
                    //                    //    {
                    //                    //        break;
                    //                    //    }
                    //                    //}

                    //                    int delay = RandomNumberGenerator.GenerateRandom(minDelayCommentByKeyword, maxDelayCommentByKeyword);
                    //                    GlobusLogHelper.log.Info(" => [ Delay For " + delay + " Seconds ]");
                    //                    Thread.Sleep(delay * 1000);
                    //                }
                    //            }
                    //        }
                    //        catch (Exception ex)
                    //        {
                    //            GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                    //        }

                    //    }
                    ////}
                    #endregion
                }
                GlobusLogHelper.log.Info(" => [ PROCESS COMPLETED " + " For " + objPinUser.Username + " ]");
                GlobusLogHelper.log.Info("---------------------------------------------------------------------------------------------------------------------------");
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
            finally
            {
                try
                {
                    if (countThreadControllerCommentByKeyword > Nothread_CommentByKeyword)
                    {
                        lock (CommentByKeywordObjThread)
                        {
                            Monitor.Pulse(CommentByKeywordObjThread);
                        }
                        CommentByKeyworddata_count--;
                    }
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error(" Error : " + ex.StackTrace);
                }
                countThreadControllerCommentByKeyword--;
            }
        }
コード例 #4
0
        public void  StartActionMultithreadUnFollow(ref PinInterestUser objPinUser)
        {
            try
            {
                try
                {
                    lstThreadsUnFollow.Add(Thread.CurrentThread);
                    lstThreadsUnFollow.Distinct().ToList();
                    Thread.CurrentThread.IsBackground = true;
                }
                catch (Exception ex)
                { };
                string        ScreenName      = objPinUser.ScreenName;
                List <string> lstNonFollowing = new List <string>();
                if (!chkUploadUnFollowList)
                {
                    if (!chkNoOFDays_UnFollow)
                    {
                        List <string> lstUsers = new List <string>();
                        try
                        {
                            lstUsers = objScrape.GetUserFollowing_new(ScreenName, NoOfPage, Globals.followingCountLogin);
                            lstUsers.Reverse();
                            lstUsers = lstUsers.Distinct().ToList();
                            if (lstUsers.Count > 0)
                            {
                                ClGlobul.lstFollowing_UnFollow.AddRange(lstUsers);
                            }

                            ClGlobul.lstFollowing_UnFollow = ClGlobul.lstFollowing_UnFollow.Distinct().ToList();
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Not Fetched User List ]");
                        }

                        lstNonFollowing.AddRange(lstUsers);
                    }
                    else if (chkNoOFDays_UnFollow == true)
                    {
                        clsSettingDB DataBase = new clsSettingDB();
                        DataTable    dt       = DataBase.SelectUnfollowsToday(objPinUser.Username);
                        foreach (DataRow rd in dt.Rows)
                        {
                            DateTime dt1          = DateTime.Parse(rd[3].ToString());
                            DateTime dt2          = DateTime.Today;
                            TimeSpan span         = dt2 - dt1;
                            int      DayDiffrence = (int)span.Days;
                            if (DayDiffrence >= NOofDays)
                            {
                                NonFollowing.Add("http://pinterest.com/" + rd[2].ToString() + "/");
                            }
                        }
                        lstNonFollowing = NonFollowing.Distinct().ToList();
                    }
                }
                if (chkUploadUnFollowList == true)
                {
                    try
                    {
                        lstNonFollowing.AddRange(ClGlobul.lstUploadUnFollowList);
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error(" Error ;" + ex.StackTrace);
                    }
                }

                if (lstNonFollowing.Count() > 0)
                {
                    int UnFollowCount = 0;
                    foreach (string UnFollowUrl in lstNonFollowing)
                    {
                        string url = string.Empty;
                        try
                        {
                            if (!UnFollowUrl.Contains("http://pinterest.com"))
                            {
                                url = "https://pinterest.com/" + UnFollowUrl + "/";
                            }
                            else
                            {
                                url = UnFollowUrl;
                            }

                            bool IsUnFollowed = UnFollow_New(url, ref objPinUser);

                            if (IsUnFollowed)
                            {
                                #region AccountReport
                                string Username = Utils.Utils.getBetween(url, ".com/", "/");
                                string module   = "UnFollow";
                                string status   = "UnFollowed";
                                Qm.insertAccRePort(objPinUser.Username, module, "", "", Username, "", "", "", status, "", "", DateTime.Now);
                                objUnFollowDelegate();

                                #endregion

                                GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Unfollowed : " + url + " From " + objPinUser.Username + " ]");
                                UnFollowCount++;
                                // MaxUnFollowCount--;
                            }
                            else
                            {
                                GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Not Unfollowed : " + url + " From " + objPinUser.Username + " ]");
                            }

                            int Delay = RandomNumberGenerator.GenerateRandom(minDelayUnFollow, maxDelayUnFollow);
                            GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Delay For " + Delay + " Seconds ]");
                            Thread.Sleep(Delay * 1000);
                        }
                        catch (Exception ex)
                        {
                            // GlobusFileHelper.AppendStringToTextfileNewLine("Error --> UnFollowUserMultiThreaded() 1--> " + ex.Message, ApplicationData.ErrorLogFile);
                        }
                        if (MaxUnFollowCount == UnFollowCount)
                        {
                            break;
                        }
                    }
                    GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED " + " For " + objPinUser.Username + " ]");
                    GlobusLogHelper.log.Info("-----------------------------------------------------------------------------------");
                }
                else
                {
                    GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ No Users to UnFollow ]");
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
            finally
            {
                try
                {
                    if (countThreadControllerUnFollow > Nothread_UnFollow)
                    {
                        lock (UnFollowObjThread)
                        {
                            Monitor.Pulse(UnFollowObjThread);
                        }
                        UnFollowdata_count--;
                    }
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error(" Error : " + ex.StackTrace);
                }
                countThreadControllerUnFollow--;
            }
        }
コード例 #5
0
        public void EditPins(ref PinInterestUser objPinUser)
        {
            try
            {
                List <string> lstOfBoardURLs = GetAllBoardNames_new1(objPinUser.ScreenName, ref objPinUser);
                foreach (var itemBoardUrl in ClGlobul.lstBoardUrls)
                {
                    string url = "https://www.pinterest.com" + itemBoardUrl;
                    lstBoardUrlsPin.Add(url);
                }

                List <string> lstPinsfromBoards = new List <string>();

                foreach (var itemBoardUrl in lstBoardUrlsPin)
                {
                    string pageSource = objPinUser.globusHttpHelper.getHtmlfromUrl(new Uri(itemBoardUrl), "", "", objPinUser.UserAgent);

                    if (!string.IsNullOrEmpty(pageSource) && pageSource.Contains("/pin/"))
                    {
                        string data = Utils.Utils.getBetween(pageSource, "/pin/", "class=").Replace("\\", "").Replace("\"", "").Replace("/", "");

                        if (!string.IsNullOrEmpty(data) && !lstPinsfromBoards.Contains(data))
                        {
                            lstPinsfromBoards.Add(data);
                        }
                    }
                }
                int count = 0;
                GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Extarcting User Pins For Edit ]");
                List <string> lstAllPins = GetAllPinsNewCode(ref objPinUser);
                Random        Pinrnd     = new Random();
                List <string> lstPins    = new List <string>();
                try
                {
                    lstPins = lstAllPins.OrderBy(X => Pinrnd.Next()).ToList();
                }
                catch { };
                lstPins.Reverse();
                GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ " + lstPins.Count + " Pins From " + objPinUser.Username + " ]");

                foreach (string Pin in lstPins)
                {
                    clsSettingDB DB = new clsSettingDB();
                    DataTable    dt = DB.SelectPinDesc(Pin, objPinUser.Username);
                    if (dt.Rows.Count <= 0)
                    {
                        string pageSource          = objPinUser.globusHttpHelper.getHtmlfromUrl(new Uri("http://pinterest.com/pin/" + Pin + "/edit/"), "", "", objPinUser.UserAgent);
                        string PinDesc             = string.Empty;
                        string csrfmiddlewaretoken = string.Empty;
                        string link  = string.Empty;
                        string board = string.Empty;

                        try
                        {
                            int    startindex = pageSource.IndexOf("description_html");
                            string start      = pageSource.Substring(startindex).Replace("description_html", "");
                            int    endIndex   = start.IndexOf(",");
                            //string end = start.Substring(0, endIndex).Replace("\"", "").Replace(":", "").Replace("","+");
                            string end = Utils.Utils.getBetween(start, "\": \"", "</a>");
                            PinDesc = end;
                        }
                        catch (Exception ex)
                        {
                        }

                        if (string.IsNullOrEmpty(PinDesc))
                        {
                            GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ No Desc In Pin :" + Pin + " ]");
                        }
                        else
                        {
                            PinCommnet = CommentList[RandomNumberGenerator.GenerateRandom(0, CommentList.Count)];

                            PinDesc = PinCommnet;
                            try
                            {
                                int    startindex = pageSource.IndexOf("\"board_id\":");
                                string start      = pageSource.Substring(startindex).Replace("\"board_id\":", "").Replace("boardRepSubtitle", "");
                                int    endIndex   = start.IndexOf(",");
                                string end        = start.Substring(0, endIndex);
                                board = end.Replace("\"", "").Replace(">", "");
                                board = board.Trim();
                            }
                            catch (Exception ex)
                            {
                            }

                            try
                            {
                                int    startindex = pageSource.IndexOf("link\": \"http:");
                                string start      = pageSource.Substring(startindex).Replace("link\":", "");
                                int    endIndex   = start.IndexOf(",");
                                string end        = start.Substring(0, endIndex).Replace("value=", "").Replace("\"", "");
                                string Link       = Utils.Utils.getBetween(start, "Link=", "");
                                link = end.Trim().Replace(":", "%3A").Replace("/", "%2F").Replace("?", "%3F").Replace("=", "%3D");
                            }
                            catch (Exception ex)
                            {
                            }
                            Thread.Sleep(1 * 1000);
                            try
                            {
                                string postdata = "board_id=" + board + "&description=" + PinDesc + "&link=" + link + "&id=" + Pin;

                                #region PostData

                                string pinUrl  = "https://www.pinterest.com/pin/" + Pin + "/";
                                string BoardId = string.Empty;

                                string getPinPageSource = objPinUser.globusHttpHelper.getHtmlfromUrl(new Uri(pinUrl), "", "", "");

                                if (getPinPageSource.Contains("\"price_currency\""))
                                {
                                    link = Utils.Utils.getBetween(getPinPageSource, "serving_link\":", ", \"is_promoted").Replace("\"", "").Trim();
                                    link = link.Replace(":", "%3A").Replace("/", "%2F").Replace("?", "%3F").Replace("=", "%3D").Replace("&", "%26");
                                }
                                if (getPinPageSource.Contains("board")) //("board_id")
                                {
                                    // BoardId = Utils.Utils.getBetween(getPinPageSource, "board\", \"id\":", ",").Replace("\"", "").Trim();
                                    BoardId = Utils.Utils.getBetween(getPinPageSource, "board\", \"id\":", "\",").Replace("\"", "").Trim();//"board", "id":
                                }
                                #endregion

                                string postPageSOurce = string.Empty;

                                string Checking = objPinUser.globusHttpHelper.getHtmlfromUrl(new Uri("https://www.pinterest.com"));
                                if (Checking.Contains("profileName"))
                                {
                                }
                                else
                                {
                                    ObjAccountManager.LoginPinterestAccount(ref objPinUser);
                                }
                                string redirectDomain = GlobusHttpHelper.valueURl.Split('.')[0];
                                string newHomePageUrl = redirectDomain + "." + "pinterest.com";
                                postdata = "source_url=%2Fpin%2F" + Pin + "%2F&data=%7B%22options%22%3A%7B%22board_id%22%3A%22" + BoardId + "%22%2C%22description%22%3A%22" + PinDesc + "%22%2C%22link%22%3A%22" + link + "%22%2C%22place%22%3A0%2C%22id%22%3A%22" + Pin + "%22%7D%2C%22context%22%3A%7B%7D%7D&module_path=App%3ECloseup%3EPinActionBar%3EShowModalButton(module%3DPinEdit)%23App%3EModalManager%3EModal(state_isVisible%3Dtrue%2C+showCloseModal%3Dtrue%2C+state_mouseDownInModal%3Dfalse%2C+state_showModalMask%3Dtrue%2C+state_showContainer%3Dfalse%2C+state_showPositionElement%3Dtrue)";
                                string postUrl = redirectDomain + ".pinterest.com/resource/PinResource/update/";

                                try
                                {
                                    postPageSOurce = objPinUser.globusHttpHelper.postFormDataProxywithCSRFToken(new Uri(postUrl), postdata, newHomePageUrl, "", 0, "", "");
                                }
                                catch
                                {
                                    Thread.Sleep(1 * 1000);
                                    postPageSOurce = objPinUser.globusHttpHelper.postFormDataProxywithCSRFToken(new Uri(postUrl), postdata, newHomePageUrl, "", 0, "", ""); //"Go0h31yGfnvXLZCw0B06nbmbxnqLj5Wj");
                                }
                                if (postPageSOurce.Contains(PinDesc))                                                                                                       //PinDesc
                                {
                                    try
                                    {
                                        GlobusFileHelper.AppendStringToTextfileNewLine(Pin + ": Desc -> " + PinDesc, PDGlobals.path_PinDescription);
                                        DB.InsertPinDesc(Pin, PinDesc, objPinUser.Username);

                                        #region AccountReport

//                                        string module = "EditPinDiscription";
//                                        string status = "Edited";
//                                        objQm.insertAccRePort(objPinUser.Username, module, "https://www.pinterest.com/pin/" + Pin, "", "", PinDesc, "", "", status, "", "", DateTime.Now);
//                                        objEditPinDescriptionDelegate();

                                        #endregion

                                        GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ " + Pin + " >>> " + PinDesc + " for " + objPinUser.Username + " ]");

                                        try
                                        {
                                            string CSV_Header = "Date" + "," + "UserName" + "," + "Pin Description" + "," + "Pin";
                                            string CSV_Data   = System.DateTime.Now.ToString() + "," + objPinUser.Username + "," + PinDesc.Replace(",", "") + "," + Pin;
                                            string path       = PDGlobals.FolderCreation(PDGlobals.Pindominator_Folder_Path, "EditPin");
                                            PDGlobals.ExportDataCSVFile(CSV_Header, CSV_Data, path + "\\EditPinDescription.csv");
                                        }
                                        catch (Exception ex)
                                        {
                                        }
                                    }
                                    catch (Exception ex)
                                    { }
                                }
                                else
                                {
                                    GlobusFileHelper.AppendStringToTextfileNewLine(Pin + ": Not Edited Description", PDGlobals.path_PinDescription);
                                    GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Description Not Edited " + Pin + ">>>>" + objPinUser.Username + " ]");
                                }
                            }

                            catch (Exception ex)
                            { };
                        }

                        int Delay = RandomNumberGenerator.GenerateRandom(minDelayEditPinDisc, maxDelayEditPinDisc);
                        GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Delay For " + Delay + " ]");
                        Thread.Sleep(Delay * 1000);
                    }
                    else
                    {
                        GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Already Edited " + Pin + " From " + objPinUser.Username + " ]");
                    }

                    if (NoOfPagesEditPinDisc == count)
                    {
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
        }
コード例 #6
0
        public void BoardMethod(string BoardName, string BoardUrl, ref PinInterestUser objPinInUser)
        {
            try
            {
                try
                {
                    lstThreadsBoards.Add(Thread.CurrentThread);
                    lstThreadsBoards.Distinct().ToList();
                    Thread.CurrentThread.IsBackground = true;
                }
                catch (Exception ex)
                { };
                lock (this)
                {
                    string           BoardId      = string.Empty;
                    AddNewPinManager objaddnewPin = new AddNewPinManager();
                    RePinManager     objRepin     = new RePinManager();
                    try
                    {
                        boardinput.Add(Thread.CurrentThread);
                        boardinput.Distinct();
                        Thread.CurrentThread.IsBackground = true;
                    }
                    catch (Exception ex)
                    { };

                    if (string.IsNullOrEmpty(BoardName))
                    {
                        try
                        {
                            List <string> baordnames = GetAllBoardNames_new(ref objPinInUser);
                            BoardName = baordnames[RandomNumberGenerator.GenerateRandom(0, baordnames.Count - 1)];
                            BoardId   = objaddnewPin.GetBoardId(BoardName, ref objPinInUser);
                        }
                        catch (Exception ex)
                        { };
                    }
                    else
                    {
                        //testing

                        GlobusHttpHelper objHttp = new GlobusHttpHelper();

                        try
                        {
                            BoardId = objaddnewPin.GetBoardId_Board(BoardName, ref objPinInUser);
                        }
                        catch (Exception ex)
                        {
                            Console.Write(ex.Message);
                        }
                    }

                    if (string.IsNullOrEmpty(BoardId))
                    {
                        BoardId = objaddnewPin.GetBoardId(BoardName, ref objPinInUser);
                    }

                    int counter      = 0;
                    int RepinCounter = 0;
                    if (!BoardId.Contains("failure"))
                    {
                        if (!string.IsNullOrEmpty(BoardId))
                        {
                            if (PDGlobals.ValidateNumber(BoardId))
                            {
                                GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Adding Pins From Board :" + BoardUrl + " ]");

                                clsSettingDB  db      = new clsSettingDB();
                                List <string> lstPins = new List <string>();
                                lstPins = GetBoardPinsNew(BoardId, BoardUrl, 10, ref objPinInUser);
                                lstPins.Distinct();
                                List <string> lstOfRepin = new List <string>();
                                lstOfRepin.AddRange(lstPins);

                                string[] lstPinNo = null;
                                lstPinNo = lstPins.ToArray();
                                //getting lstPins length
                                int lenOFlstPins = lstOfRepin.Count;

                                foreach (string Pins in lstPinNo)
                                {
                                    if (MaxRePinCount > RepinCounter)
                                    {
                                        string Message = string.Empty;
                                        if (ClGlobul.lstBoardRepinMessage.Count > 0)
                                        {
                                            if (counter < ClGlobul.lstBoardRepinMessage.Count)
                                            {
                                                Message = ClGlobul.lstBoardRepinMessage[counter];
                                            }
                                            else
                                            {
                                                counter = 0;
                                                Message = ClGlobul.lstBoardRepinMessage[counter];
                                            }
                                        }

                                        bool IsReppined = false;
                                        if (!Pins.Contains("n"))
                                        {
                                            try
                                            {
                                                int index = lstOfRepin.Where(x => x == Pins).Select(x => lstOfRepin.IndexOf(x)).Single <int>();

                                                string NoOfPages = Convert.ToString(index / lenOFlstPins);

                                                IsReppined = objRepin.RepinwithMessage(Pins, Message, BoardId, NoOfPages, ref objPinInUser);
                                            }

                                            catch { }
                                            if (IsReppined)
                                            {
                                                //GlobusLogHelper.log.Info("[ => [ Repin Id : " + Pins + " ]");
                                                #region AccountReport

                                                string module = "Boards";
                                                string status = "Repined";
                                                Qm.insertAccRePort(objPinInUser.Username, module, "https://www.pinterest.com/pin/" + Pins, BoardName, "", "", "", "", status, "", "", DateTime.Now);
                                                objBoardDelegate();

                                                #endregion

                                                GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Repin Pin : " + Pins + " to Account : " + objPinInUser.Username + " In " + BoardName + " ]");
                                                try
                                                {
                                                    string CSV_Header = "Date" + "," + "UserName" + "," + "Message" + "," + "Pin" + "Board Id";
                                                    string CSV_Data   = System.DateTime.Now.ToString() + "," + objPinInUser.Username + "," + Message + "," + "https://www.pinterest.com/pin/" + Pins + "," + BoardId;

                                                    PDGlobals.ExportDataCSVFile(CSV_Header, CSV_Data, Boardpath + "\\Board.csv");
                                                    RepinCounter++;
                                                }
                                                catch (Exception ex)
                                                {
                                                    Console.Write(ex.Message);
                                                }

                                                //kept here
                                                int delay = RandomNumberGenerator.GenerateRandom(minDelayBoards, maxDelayBoards);
                                                GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Delay for " + delay + " Seconds ]");
                                                Thread.Sleep(delay * 1000);
                                            }
                                            else
                                            {
                                            }

                                            counter++;
                                        }
                                    }
                                    else
                                    {
                                        GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED " + " For " + objPinInUser.Username + " In " + BoardName + "]");
                                        GlobusLogHelper.log.Info("-----------------------------------------------------------------------------");
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        GlobusLogHelper.log.Info("[ " + DateTime.Now + " ]  => [ You already have a board with that name. " + objPinInUser.Username + " ]");
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
        }
コード例 #7
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);
            }
        }
コード例 #8
0
        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);
            }
        }
コード例 #9
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);
            }
        }
コード例 #10
0
        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);
            }
        }
コード例 #11
0
ファイル: frmMain.cs プロジェクト: brentscheidt/inboard
        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... ]");
            }
        }
コード例 #12
0
ファイル: frmMain.cs プロジェクト: brentscheidt/inboard
        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... ]");
            }
        }
コード例 #13
0
        public void UserFollowes(ref PinInterestUser objPinUser, List <string> myList)
        {
            try
            {
                List <string> Followerlist = new List <string>();
                if (rbFollowFollowers == true)
                {
                    objPinUser.lstUserFollowers = myList;
                    Followerlist = myList;
                }
                if (rbFollowUser == true)
                {
                    Followerlist = myList;
                    Followerlist = Followerlist.Distinct().ToList();
                }
                try
                {
                    int CountToday  = 0;
                    int CountByUser = 0;
                    foreach (var itemlist in Followerlist)
                    {
                        string FollowUrl = itemlist.ToString();
                        try
                        {
                            bool followedAlready = false;

                            if (followedAlready)
                            {
                                GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ User " + FollowUrl + " already followed ]");
                            }
                            else
                            {
                                string IsFollowed = FollowPeople_New(FollowUrl, ref objPinUser);

                                if (IsFollowed == "Followed")
                                {
                                    #region AccountReport

                                    string module = "FollowByUsername";
                                    string status = "Followed";
                                    QM.insertAccRePort(objPinUser.Username, module, "", "", FollowUrl, "", "", "", status, "", "", DateTime.Now);
                                    objFollowByUsernameDelegate();

                                    #endregion

                                    GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Followed " + FollowUrl + " From " + objPinUser.Username + " ]");
                                    FollowCount++;
                                    CountToday++;
                                    clsSettingDB Db = new clsSettingDB();
                                    Db.insertFollowDate(objPinUser.Username, FollowUrl, "");

                                    try
                                    {
                                        string CSV_Header = "UserName" + "," + "Follow Url" + "," + "Date";
                                        string CSV_Data   = objPinUser.Username + "," + "https://www.pinterest.com/" + FollowUrl + "," + System.DateTime.Now.ToString();
                                        string path       = PDGlobals.FolderCreation(PDGlobals.Pindominator_Folder_Path, "Follow");
                                        PDGlobals.ExportDataCSVFile(CSV_Header, CSV_Data, path + "\\FollowUserFollowers.csv");
                                    }
                                    catch (Exception ex)
                                    {
                                    }
                                }
                                else if (IsFollowed == " ")
                                {
                                    GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Already Followed " + FollowUrl + " From " + objPinUser.Username + " ]");
                                }
                                else
                                {
                                    GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Could Not Follow " + FollowUrl + " From " + objPinUser.Username + " ]");
                                    Thread.Sleep(1000);
                                    continue;
                                }
                            }
                            if (MaxFollowCount == CountToday)
                            {
                                break;
                            }
                            int Delay = RandomNumberGenerator.GenerateRandom(minDelayFollowByUsername, maxDelayFollowByUsername);
                            GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Delay For " + Delay + " Seconds ]");
                            Thread.Sleep(Delay * 1000);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                        }
                    }
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error :" + ex.StackTrace);
            }
        }
コード例 #14
0
ファイル: frmAccounts.cs プロジェクト: ondrocks/inboard
        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
            {
            }
        }
コード例 #15
0
ファイル: frmAccounts.cs プロジェクト: brentscheidt/inboard
        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
            {
            }
        }