我正在尝试在skydrive上下载文件,但它无法正常工作。
LiveConnectClient client = new LiveConnectClient(session);
client.DownloadCompleted += new EventHandler<LiveDownloadCompletedEventArgs>(DownloadCompleted);
client.DownloadAsync(fileid);
//-----------------------------------------------------------------
void DownloadCompleted(object sender, LiveOperationCompletedEventArgs e)
{
StreamReader reader = new StreamReader(e.Result);
string text = reader.ReadToEnd();
IsolatedStorageFile Isofiles = IsolatedStorageFile.GetUserStoreForApplication();
using (var isoFileStream = new IsolatedStorageFileStream("Testfile", FileMode.OpenOrCreate, Isofiles))
{
using (var isoFileWriter = new StreamWriter(isoFileStream))
{
isoFileWriter.Write(text);
}
}
}
我做错了什么?
答案 0 :(得分:0)
您只能使用此行获取元数据
client.DownloadAsync(fileid);
像这样添加/ content到fileid以获取实际的文件内容。
client.DownloadAsync(fileid + "/content");