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


C# oAuthTwitter.AuthorizationLinkGet方法代码示例

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


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

示例1: AuthenticateTwitter

        public void AuthenticateTwitter(object sender, EventArgs e)
        {
            TwitterHelper twthelper = new TwitterHelper();
            string twtredirecturl = twthelper.TwitterRedirect(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]);
            Response.Redirect(twtredirecturl);

            oAuthTwitter OAuth = new oAuthTwitter();

            if (Request["oauth_token"] == null)
            {
                OAuth.AccessToken = string.Empty;
                OAuth.AccessTokenSecret = string.Empty;
                OAuth.CallBackUrl = ConfigurationManager.AppSettings["callbackurl"].ToString();
                this.TwitterOAuth.HRef = OAuth.AuthorizationLinkGet();
                Response.Redirect(OAuth.AuthorizationLinkGet());
            }
        }
开发者ID:utkarshx,项目名称:socioboard,代码行数:17,代码来源:Home.aspx.cs

示例2: AuthenticateTwitter

        public void AuthenticateTwitter(object sender, EventArgs e)
        {
            oAuthTwitter OAuth = new oAuthTwitter();

            if (Request["oauth_token"] == null)
            {
                OAuth.AccessToken = string.Empty;
                OAuth.AccessTokenSecret = string.Empty;
                OAuth.CallBackUrl = ConfigurationManager.AppSettings["callbackurl"].ToString();
                Response.Redirect(OAuth.AuthorizationLinkGet());
            }
        }
开发者ID:utkarshx,项目名称:socioboard,代码行数:12,代码来源:Publishing.aspx.cs

示例3: TwitterRedirect

        public void TwitterRedirect(object sender, EventArgs e)
        {
            if (ddlGroup.SelectedItem.Text != "Select")
            {
                Session["UserAndGroupsForTwitter"] = "twitter";

                oAuthTwitter OAuth = new oAuthTwitter();

                if (Request["oauth_token"] == null)
                {
                    OAuth.AccessToken = string.Empty;
                    OAuth.AccessTokenSecret = string.Empty;
                    OAuth.CallBackUrl = ConfigurationManager.AppSettings["callbackurl"].ToString();
                    Response.Redirect(OAuth.AuthorizationLinkGet());
                }
            }
            else
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "test", "<script type=\"text/javascript\">alert(\"Select the group to add profiles\")</script>", false);

            }
        }
开发者ID:NALSS,项目名称:socioboard,代码行数:22,代码来源:UsersAndGroups.aspx.cs

示例4: TwitterOAuthRedirect

        public void TwitterOAuthRedirect(object sender, EventArgs e)
        {
            User user = (User)Session["LoggedUser"];

            oAuthTwitter OAuth = new oAuthTwitter();

            if (ddlGroup.SelectedIndex > 0)
            {
                HiddenFieldGroupNameInDDl.Value = ddlGroup.SelectedItem.Text;

                if (!string.IsNullOrEmpty(HiddenFieldGroupNameInDDl.Value))
                {
                    GroupRepository grouprepo = new GroupRepository();
                    Groups group = grouprepo.getGroupDetails(user.Id, HiddenFieldGroupNameInDDl.Value.ToString());
                    Session["GroupName"] = group;
                    TwitterHelper twthelper = new TwitterHelper();
                    string twtredirecturl = twthelper.TwitterRedirect(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]);
                    Response.Redirect(twtredirecturl);

                }
            }
            else
            {
                try
                {
                    string txtgroup = Page.Request.Form["txtGroupName"].ToString();

                    if (!string.IsNullOrEmpty(txtgroup))
                    {
                        GroupRepository grouprepo = new GroupRepository();
                        Groups group = new Groups();
                        group.Id = Guid.NewGuid();
                        group.GroupName = txtgroup;
                        group.UserId = user.Id;
                        group.EntryDate = DateTime.Now;
                        if (!grouprepo.checkGroupExists(user.Id, txtgroup))
                        {
                            grouprepo.AddGroup(group);
                            Groups grou = grouprepo.getGroupDetails(user.Id, txtgroup);
                            Session["GroupName"] = grou;
                        }
                        else
                        {
                            Groups grou = grouprepo.getGroupDetails(user.Id, txtgroup);
                            Session["GroupName"] = grou;
                        }
                        if (Request["oauth_token"] == null)
                        {
                            Session["UserAndGroupsForTwitter"] = "twitter";
                            OAuth.AccessToken = string.Empty;
                            OAuth.AccessTokenSecret = string.Empty;
                            OAuth.CallBackUrl = ConfigurationManager.AppSettings["callbackurl"].ToString();
                            this.TwitterOAuth.HRef = OAuth.AuthorizationLinkGet();
                            Response.Redirect(OAuth.AuthorizationLinkGet());
                        }
                    }
                    else
                    {
                        Response.Write("<script>alert(\"Please Add new Group or Select Existing Group\");</script>");
                    }

                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
            }
        }
开发者ID:utkarshx,项目名称:socioboard,代码行数:68,代码来源:UsersAndGroups.aspx.cs


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