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


C# Twitter.SaveTwitterAccess方法代码示例

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


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

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            string function = core.Http["fun"];

            string oAuthToken;
            string oAuthVerifier;

            switch (function)
            {
                case "form":
                    break;
                case "date":
                    string date = core.Functions.InterpretDate(core.Http.Form["date"], (DisplayMedium)int.Parse(core.Http.Form["Medium"]));
                    core.Response.SendRawText("date", date);
                    return;
                case "time":
                    string time = core.Functions.InterpretTime(core.Http.Form["time"]);
                    core.Response.SendRawText("time", time);
                    return;
                case "friend-list":
                    ReturnFriendList();
                    return;
                case "tag-list":
                    ReturnTagList();
                    return;
                case "search-list":
                    return;
                case "contact-card":
                    ReturnContactCard();
                    return;
                case "feed":
                    if (core.Http.Form["view-mode"] == "tick")
                    {
                        long viewId = 0;
                        viewId = core.Functions.FormLong("vid", core.Functions.RequestLong("vid", 0));

                        if (viewId > 0)
                        {
                            ItemView.UpdateView(core, false);
                        }
                    }

                    CheckNewFeedItems();
                    return;
                case "permission-groups-list":
                    core.Functions.ReturnPermissionGroupList(ResponseFormats.Xml);
                    return;
                case "embed":
                    ReturnItemEmbedCode();
                    return;
                case "twitter":
                    Twitter t = new Twitter(core.Settings.TwitterApiKey, core.Settings.TwitterApiSecret);

                    oAuthToken = core.Http.Query["oauth_token"];
                    oAuthVerifier = core.Http.Query["oauth_verifier"];

                    t.SaveTwitterAccess(core, oAuthToken, oAuthVerifier);

                    return;
                case "tumblr":
                    Tumblr tr = new Tumblr(core.Settings.TumblrApiKey, core.Settings.TumblrApiSecret);

                    oAuthToken = core.Http.Query["oauth_token"];
                    oAuthVerifier = core.Http.Query["oauth_verifier"]; // + "#_=_";

                    tr.SaveTumblrAccess(core, oAuthToken, oAuthVerifier);
                    return;
                case "googleplus":
                    /*Google g = new Google(core.Settings.GoogleApiKey, core.Settings.GoogleApiSecret);

                    string oAuthCode = core.Http.Query["code"];

                    g.SaveGoogleAccess(core, oAuthToken, oAuthCode);*/

                    return;
                case "facebook":
                    Facebook fb = new Facebook(core.Settings.FacebookApiAppid, core.Settings.FacebookApiSecret);

                    string errorReason = core.Http.Query["error_reason"];
                    string code = core.Http.Query["code"];

                    if (!(errorReason == "user_denied"))
                    {
                        fb.SaveFacebookAccess(core, code);
                    }
                    else
                    {
                        core.Http.Redirect(core.Hyperlink.BuildAccountSubModuleUri("dashboard", "preferences") + "?status=facebook-auth-failed");
                    }

                    return;
                case "boxsocial":
                    NameValueCollection response = new NameValueCollection();

                    core.Http.WriteAndEndResponse(response);
                    break;
                case "oauth":
                    string method = core.Http.Query["method"];
                    switch (method)
                    {
//.........这里部分代码省略.........
开发者ID:smithydll,项目名称:boxsocial,代码行数:101,代码来源:functions.aspx.cs


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