当前位置: 首页>>代码示例>>C#>>正文


C# clsDBQueryManager.SelectFollowDUsernameID_List方法代码示例

本文整理汇总了C#中BaseLib.clsDBQueryManager.SelectFollowDUsernameID_List方法的典型用法代码示例。如果您正苦于以下问题:C# clsDBQueryManager.SelectFollowDUsernameID_List方法的具体用法?C# clsDBQueryManager.SelectFollowDUsernameID_List怎么用?C# clsDBQueryManager.SelectFollowDUsernameID_List使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseLib.clsDBQueryManager的用法示例。


在下文中一共展示了clsDBQueryManager.SelectFollowDUsernameID_List方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FollowUsingURLs


//.........这里部分代码省略.........
                                    }
                                }
                                else if (frmMain_NewUI.IsfollowerUserId && BaseLib.NumberHelper.ValidateNumber(user_id_toFollow))
                                {
                                    lst_AlreadyExist = DB.SelectUnFollowedUsername_List(Username);
                                    bool isAlreadyExist = lst_AlreadyExist.Exists(s => (s == user_id_toFollow));
                                    if (isAlreadyExist)
                                    {
                                        Log("[ " + DateTime.Now + " ] => [ " + user_id_toFollow + " Is already Unfollowed before from " + Username + " ]");
                                        continue;
                                    }
                                }
                            }

                            #endregion

                            ///Counter For Follow
                            NoOfFollowCounter++;

                            //Check if user_id_toFollow is already being followed or not

                            #region user_id_toFollow is already being followed or not

                            bool isAlreadyFollowed = false;
                            Log("[ " + DateTime.Now + " ] => [ Checking For Already Followed For " + user_id_toFollow + " From " + Username + " ]");
                            if (frmMain_NewUI.IsFollowerScreenName)
                            {
                                lst_AlreadyUserName = queryManager.SelectFollowDUsername_List(Username);
                                isAlreadyFollowed = lst_AlreadyUserName.Exists(s => (s == user_id_toFollow));
                                Screen_name = user_id_toFollow;
                            }
                            else if (frmMain_NewUI.IsfollowerUserId && BaseLib.NumberHelper.ValidateNumber(user_id_toFollow))
                            {
                                lst_AlreadyUserid = queryManager.SelectFollowDUsernameID_List(Username);
                                isAlreadyFollowed = lst_AlreadyUserid.Exists(s => (s == user_id_toFollow));
                                user_id = user_id_toFollow;
                            }
                            else
                            {
                                Log("[ " + DateTime.Now + " ] => [ UserId/ScreenName Not In Correct Format :- " + user_id_toFollow + " ]");
                                return;
                            }

                            #endregion

                            if (!isAlreadyFollowed)  //If not already being followed, follow now
                            {
                                ///Use FollowingsFollowers Ratio Filter
                                if (UseRatioFilter)
                                {
                                    int FollowingsFollowersRatio_user_id = 0;

                                    //Check FollowingsFollowers Ratio of this user_id
                                    try
                                    {
                                        string returnstatusFollower = string.Empty;
                                        string returnstatusFollowing = string.Empty;
                                        List<string> Following = dataScrapper.GetFollowings(user_id, out returnstatusFollowing);
                                        List<string> Follower = dataScrapper.GetFollowers(user_id, out returnstatusFollower);
                                        int count_Followings_user_id = Following.Count;
                                        int count_Followers_user_id = Follower.Count;

                                        FollowingsFollowersRatio_user_id = (count_Followings_user_id * 100) / count_Followers_user_id;
                                    }
                                    catch (Exception ex)
                                    {
开发者ID:ahmetDostr,项目名称:twtboard,代码行数:67,代码来源:TweetAccountManager.cs

示例2: UnFollowUsingURLs

        public void UnFollowUsingURLs(List<string> list_user_id_toUnFollow, int minDelay, int maxDelay)
        {
            //Login();

            try
            {
                if (!IsLoggedIn)
                {
                    Login();
                }
                if (IsNotSuspended)
                {
                    if (IsLoggedIn)
                    {
                        int counter_Unfollow = 0;

                        if (list_user_id_toUnFollow.Count > 0)
                        {
                            Log("[ " + DateTime.Now + " ] => [ You have selected : " + list_user_id_toUnFollow.Count() + " ID to be Unfollowed ]");

                            foreach (string _user_id_toUnFollow in list_user_id_toUnFollow)
                            {
                                string _ScreenName = string.Empty;
                                string user_id_toUnFollow = string.Empty;
                                if (_user_id_toUnFollow.Contains(":"))
                                {
                                    try
                                    {
                                        _ScreenName = _user_id_toUnFollow.Split(':')[0];

                                        user_id_toUnFollow = _user_id_toUnFollow.Split(':')[1];
                                    }
                                    catch { };
                                }
                                else
                                {
                                    user_id_toUnFollow = _user_id_toUnFollow;
                                }

                                if (counter_Unfollow >= noOfUnfollows)
                                {
                                    break;
                                }

                                string unFollowStatus;

                                unFollower.UnFollowUsingProfileID(ref globusHttpHelper, pgSrc_Profile, postAuthenticityToken, user_id_toUnFollow, out unFollowStatus);
                                int Delay = 10;
                                try
                                {
                                    if (Globals.IsGlobalDelay && Globals.IsCheckValueOfDelay)
                                    {
                                        Delay = RandomNumberGenerator.GenerateRandom(Globals.MinGlobalDelay, Globals.MaxGlobalDelay);
                                    }
                                    else
                                    {
                                        Delay = RandomNumberGenerator.GenerateRandom(minDelay, maxDelay);
                                    }
                                }
                                catch (Exception ex)
                                {
                                    //GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> FollowUsingURLs() -- delay --> " + ex.Message, Globals.Path_FollowerErroLog);
                                    //GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TweetAccountManager --  FollowUsingURLs() -- delay -- " + Username + " -- " + user_id_toFollow + " --> " + ex.Message, Globals.Path_TweetAccountManager);
                                }

                                if (unFollowStatus == "Unfollowed" || unFollowStatus == "Already Unfollowed")
                                {
                                    counter_Unfollow++;
                                    if (unFollowStatus == "Already Unfollowed")
                                    {
                                        Log("[ " + DateTime.Now + " ] => [ >> Already Unfollowed >> " + user_id_toUnFollow + " by " + Username + " ]");
                                    }
                                    else
                                    {
                                        Log("[ " + DateTime.Now + " ] => [ >> Unfollowed >> " + user_id_toUnFollow + " by " + Username + " ]");
                                    }
                                    //Thread.Sleep(RandomNumberGenerator.GenerateRandom(3000, 5000));

                                    GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword + ":" + user_id_toUnFollow, Globals.path_SuccessfullyUnfollowAccounts);
                                    clsDBQueryManager queryManager = new clsDBQueryManager();
                                    List<string> lst_AlreadyUserName = queryManager.SelectFollowDUsernameID_List(Username);
                                    bool isAlreadyFollowed = lst_AlreadyUserName.Exists(s => (s == user_id_toUnFollow));
                                    if (isAlreadyFollowed)
                                    {
                                        queryManager.DeleteFollowDUsernameID_List(Username, user_id_toUnFollow);
                                    }
                                    try
                                    {
                                        string status = string.Empty;
                                        //get screen name or id
                                        if (NumberHelper.ValidateNumber(user_id_toUnFollow) && string.IsNullOrEmpty(_ScreenName))
                                        {
                                            _ScreenName = TwitterDataScrapper.GetUserNameFromUserId_New(user_id_toUnFollow, out status, ref globusHttpHelper);
                                        }
                                        queryManager.InserOrUpdateUnfollower(Username, user_id_toUnFollow, _ScreenName);
                                    }
                                    catch (Exception)
                                    {
                                    }
                                }
//.........这里部分代码省略.........
开发者ID:ahmetDostr,项目名称:twtboard,代码行数:101,代码来源:TweetAccountManager.cs


注:本文中的BaseLib.clsDBQueryManager.SelectFollowDUsernameID_List方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。