[英]WP7-Skydrive API Download Any file and Save Isolated Storage
我正在尝试在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);
}
}
}
我究竟做错了什么?
您只能通过此行获取元数据
client.DownloadAsync(fileid);
像这样在文件ID中添加/ content以获得实际的文件内容。
client.DownloadAsync(fileid + "/content");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.