我正在使用twitter登錄&通過使用Github Twitterizer版本2.4.2保存Access-token,AccessTokenSecret離線推文。使用Twitterizer API(Github)版本2.4.2問題
DLL文件:
1)Twitterizer版本2.4.2
2)Newtonsoft.Json版本4.5.5
結果: 我們正在下面的結果。
訪問級別:Twitterizer.AccessLevel.Unavailable 內容: 「」 結果:未經授權
RequestUrl:http://api.twitter.com/1/account/verify_credentials.json
我們無法在發送像訪問令牌,AccessTokenSecret細節得到JSON數據,消費者密鑰,消費者密鑰。 我們還在SSL/TLS服務器上安裝了PCA-3G2.pem和PCA-3G3.pem證書,但我們仍然面臨這個問題。請幫助解決問題。 (找到下面的代碼片段,我在我的web應用程序中使用)
代碼:
OAuthTokens tokens = new OAuthTokens()
{
Access-token = XXX-XXX,
AccessTokenSecret =XXX-XXX,
ConsumerKey = XXX-XXX,
ConsumerSecret = XXX-XXX
};
TwitterResponse<TwitterUser> twitterResponse = TwitterAccount.VerifyCredentials(tokens);
if (twitterResponse.Result == RequestResult.Success)
{
ResultLabel.Text = string.Format("Success! Verified as {0}", twitterResponse.ResponseObject.ScreenName);
TwitterResponse<TwitterStatus> twitterRes = TwitterStatus.Update(tokens, "Some 2", null);
ResultLabel.CssClass = "ResultLabelSuccess";
if (twitterRes.Result == RequestResult.Success)
{
ResultLabel.Text += string.Format(". Update Status Success!! Updated text {0}", twitterRes.ResponseObject.Text);
ResultLabel.CssClass = "ResultLabelSuccess";
}
else
{
ResultLabel.Text += string.Format(". Update Status Failed! {0}", twitterRes.ErrorMessage);
ResultLabel.CssClass = "ResultLabelFailed";
}
}
else
{
ResultLabel.Text = string.Format("Failed! \"{0}\"", twitterResponse.ErrorMessage ?? "Not Authorized.");
ResultLabel.CssClass = "ResultLabelFailed";
}
大衛,你能告訴我你提到要改變的班級在哪裏嗎? – Giuseppe