我正在让facebook登录到我的窗口电话8.1。当单击登录按钮时,它会破坏应用程序,让我知道
“System.NotImplementedException”类型的异常发生在mypriject.exe中,但未在用户代码中处理 补充资料:未执行 如果存在此异常的处理程序,则可以安全地继续该程序。
然后带我到这个app.g.i.cs页面并高亮显示这一行
#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
UnhandledException += (sender, e) =>
{
if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
};**这是我的代码,请帮助我**
public sealed partial class BlankPage1 : Page
{
FacebookClient fb = new FacebookClient();
string AccessToken = null;
public BlankPage1()
{
this.InitializeComponent();
}
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached.
/// This parameter is typically used to configure the page.</param>
private async void Button_Click(object sender, RoutedEventArgs e)
{
string redirect_url="https://www.facebook.com/connect/login_seccess.html";
var loginURL = fb.GetLoginUrl(new{
client_id ="**myapp id here**",
redirect_uri = redirect_url,
response_type ="token",
scope ="email,publish_stream,user_groups"
});
var res= await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None,loginURL,new Uri(redirect_url) );
if(res.ResponseStatus==WebAuthenticationStatus.Success)
{
var callback = new Uri(res.ResponseData.ToString());
var token = fb.ParseOAuthCallbackUrl(callback);
AccessToken = token.AccessToken;
await new MessageDialog("AccessToken").ShowAsync();
}
}
}发布于 2014-12-11 08:01:54
在Windows 8.1中,AuthenticateAsync将无法使用此
WebAuthenticationBroker.AuthenticateAndContinue(loginURL,空WebAuthenticationOptions.None);
https://stackoverflow.com/questions/27269952
复制相似问题