0

我正在尝试在 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);
                }
            }
        }

我究竟做错了什么?

4

1 回答 1

0

您只能通过此行获取元数据

client.DownloadAsync(fileid);

像这样将 /content 添加到 fileid 以获取实际的文件内容。

client.DownloadAsync(fileid + "/content");
于 2013-07-08T20:14:41.400 回答