2015-09-14 55 views
-1

我想使用c#從onedrive下載文件。如何在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); 

回答

0

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

完整,詳細的說明在這裏:

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

+0

我知道圖書館的網站,但我希望有一個代碼。 –

+0

我提出了一些很好的步驟來幫助你解決這個問題。 [鏈接](http://stackoverflow.com/questions/43834739/how-to-upload-and-download-file-to-onedrive-for-business-using-c-sharp-applicati/43835418#43835418) –