我正在创建一个带有 SkyDrive 访问权限的 WP7 应用程序。我正在使用 SkyDrive API。当我尝试登录时,它显示“无效请求”错误。谁能告诉我我的代码有什么问题?
private void login_Click()
{
LiveAuthClient auth = new LiveAuthClient("signInButton1.ClientId");
auth.LoginCompleted +=
new EventHandler<LoginCompletedEventArgs>(MoreScopes_LoginCompleted);
auth.LoginAsync(new string[] { "wl.signin", "wl.basic", "wl.skydrive", "wl.skydrive_update " });
}
void MoreScopes_LoginCompleted(object sender, LoginCompletedEventArgs e)
{
if (e.Status == LiveConnectSessionStatus.Connected)
{
LiveConnectSession session = e.Session;
LiveConnectClient client = new LiveConnectClient(session);
infoTextBlock.Text = "Signed in.";
}
else if (e.Error != null)
{
infoTextBlock.Text = "Error signing in: " + e.Error.ToString();
}
}
private void signInButton1_SessionChanged(object sender, Microsoft.Live.Controls.LiveConnectSessionChangedEventArgs e)
{
login_Click();
}