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


C# clsDBQueryManager.InserOrUpdateUnfollower方法代码示例

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


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

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