【发布时间】:2013-01-30 16:27:45
【问题描述】:
所以我一直在使用 Linq-To-Twitter 将 Twitter 集成添加到我的 Windows 8 应用商店应用程序中,Moreso 用于玩弄它,但我遇到了一个问题。我当前的身份验证代码块是
var auth = new WinRtAuthorizer
{
Credentials = new LocalDataCredentials
{
ConsumerKey = "",
ConsumerSecret = ""
},
UseCompression = true,
Callback = new Uri("http://linqtotwitter.codeplex.com/")
};
if (auth == null || !auth.IsAuthorized)
{
await auth.AuthorizeAsync();
}
这很好用,除非我进入身份验证屏幕并单击左上角的后退按钮以退出身份验证而不提供详细信息。此时我得到一个 TwitterQueryException: Bad Authentication data at:
var timelineResponse =
(from tweet in twitterCtx.Status
where tweet.Type == StatusType.Home
select tweet)
.ToList();
显然,因为身份验证信息错误,我正在尝试找到一种方法,以在身份验证失败/退出时停止继续执行其余代码。
我尝试过简单的布尔检查,但没有任何效果。几个小时以来,我一直在融化我的大脑,所以任何帮助都将不胜感激。非常感谢!
【问题讨论】:
标签: c# windows-8 microsoft-metro windows-store-apps linq-to-twitter