本文整理汇总了C#中TweetSharp.TwitterService.GetAuthenticationUrl方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterService.GetAuthenticationUrl方法的具体用法?C# TwitterService.GetAuthenticationUrl怎么用?C# TwitterService.GetAuthenticationUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TweetSharp.TwitterService
的用法示例。
在下文中一共展示了TwitterService.GetAuthenticationUrl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Authorize
public ActionResult Authorize()
{
// Step 1 - Retrieve an OAuth Request Token
TwitterService service = new TwitterService(AuthenticationTokens.TwitterConsumerKey, AuthenticationTokens.TwitterConsumerSecret);
OAuthRequestToken requestToken = service.GetRequestToken("http://localhost:63516/Account/AuthorizeCallback"); // <-- The registered callback URL
// Step 2 - Redirect to the OAuth Authorization URL
Uri uri = service.GetAuthenticationUrl(requestToken);
return new RedirectResult(uri.ToString(), false /*permanent*/);
}
示例2: authTwitter
private void authTwitter(TwitterService twitterService)
{
string authUri = twitterService.GetAuthenticationUrl(requestToken).ToString();
System.Diagnostics.Process.Start(authUri.ToString());
SettingsManager SM = new SettingsManager();
SM.ShowDialog();
pin = SM.twitterPIN;
oAccessToken = twitterService.GetAccessToken(requestToken, pin);
AdvancedSoftwareProject.Properties.Settings.Default.AccessToken = oAccessToken.Token;
AdvancedSoftwareProject.Properties.Settings.Default.AccessTokenSecret = oAccessToken.TokenSecret;
AdvancedSoftwareProject.Properties.Settings.Default.Save();
twitterService.AuthenticateWith(AdvancedSoftwareProject.Properties.Settings.Default.AccessToken, AdvancedSoftwareProject.Properties.Settings.Default.AccessTokenSecret);
}
示例3: tw_connection
/// <summary>
/// Open twitter auth page
/// </summary>
private void tw_connection()
{
TwitterService twService = new TwitterService(SWTwitterSettings.ConsumerKey,
SWTwitterSettings.ConsumerSecret);
twService.GetRequestToken((token, response) =>
{
// Handle errors
if (token == null)
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
displayErrorAndGoBack("Cannot authorize Twitter." + Environment.NewLine
+ "Please check your internet");
});
System.Diagnostics.Debug.WriteLine(response.Response);
return;
}
// Save request token
this.tw_requestToken = token;
// Navigate to auth page
Uri uri = twService.GetAuthenticationUrl(token);
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
System.Diagnostics.Debug.WriteLine(uri.ToString());
authBrowser.Navigate(uri);
});
});
}