我已经通过API从谷歌驱动器下载了文件。 我唯一的问题是我无法在任何地方找到如何更改文件的目标位置。它全部下载到DEBUG文件夹。
以下是代码:
var request = service.Files.Get(fileId);
var stream = new System.IO.MemoryStream();
Utilities.Log("Starting download..");
request.MediaDownloader.ProgressChanged +=
(download_stat) => {
switch (download_stat.Status) {
case DownloadStatus.Downloading: {
Console.WriteLine(download_stat.BytesDownloaded);
break;
}
case DownloadStatus.Completed: {
Console.WriteLine("Download complete.");
break;
}
case DownloadStatus.Failed: {
Console.WriteLine("Download failed.");
break;
}
}
};
request.Download(stream);
THX