本文整理汇总了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());
}
}
示例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());
}
}
示例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);
}
}
示例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);
}
}
}