我不確定哪個程序集是用於Windows Phone的正確程序集。以下Url展示了一個使用LiveSDK的例子。用於Windows Phone的LiveSDK(LiveConnect Api)或SkyDrive API
我已經加入Microsoft.Live
和Microsoft.Live.Control
爲參考
代碼:
client.Session.Status != LiveConnectSessionStatus.Connected
錯誤:
'Microsoft.Live.LiveConnectSession' does not contain a definition for 'Status'
and no extension method 'Status' accepting a first argument of type 'Microsoft.Live.LiveConnectSession'
could be found (are you missing a using directive or an assembly reference?)
代碼:
private LiveConnectClient client;
private void UploadPhoto_Click(object sender, EventArgs e)
{
if (client == null || client.Session == null || client.Session.Status != LiveConnectSessionStatus.Connected)
{
MessageBox.Show("You must sign in first.");
}
else
{
client.GetCompleted += new EventHandler<LiveOperationCompletedEventArgs>(GetFolderProperties_Completed);
// If you put photo to folder it becomes album.
client.GetAsync("me/skydrive/files?filter=folders,albums");
}
}
謝謝指出差異。所以,在上傳功能中,我是否需要檢查:client.Session.Status!= LiveConnectSessionStatus.Connected?登錄檢查現在可以:e.Status == LiveConnectSessionStatus.Connected – MilkBottle 2011-12-15 09:45:30