我正在尝试在 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);
}
}
}
我究竟做错了什么?