即时通讯让我登录到我的窗口手机8.1。当点击登录按钮时,它会破坏应用程序的年龄
然后带我去看看 app.g.i.cs页面并突出显示此行类型' System.NotImplementedException'的例外情况发生在 mypriject.exe但未在用户代码中处理
其他信息:未实施
如果存在此异常的处理程序,则程序可能是安全的 继续进行。
#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();
}
}
}
答案 0 :(得分:1)
AuthenticateAsync不起作用 使用这个
WebAuthenticationBroker.AuthenticateAndContinue(loginURL,null WebAuthenticationOptions.None);