如何在onedrive中下载文件

时间:2015-09-14 18:05:13

标签: c# download onedrive

我想使用c#从onedrive下载文件。

string arquivo = "file.921a7aadee6beb12.921A7AADEE6BEB12!7177";
 string pastaOrigem = "C:\\Users\\Usuario\\Desktop\\Pasta Origem";
 StringBuilder requestDownload = new StringBuilder();
 requestDownload.AppendFormat("https://apis.live.net/v5.0/{0}/content?access token={1}", arquivo, propriedades["access_token"]);
 WebClient myWebClientDownload = new WebClient();
 myWebClientDownload.DownloadFile(requestDownload.ToString(), pastaOrigem);

1 个答案:

答案 0 :(得分:0)

最好的方法是使用Onedrive REST API。

完整,详细的说明:

https://msdn.microsoft.com/en-us/library/office/dn659726.aspx