私はhttps://developers.google.com/drive/v3/web/manage-downloadsを使用していますが、私はアクセス権を持ってGoogleドライブからファイルをダウンロードできるコードの作業コピーを持っています。それが真のDOCファイルは、あなたならGoogleドキュメントの内容を読む方法
private static void DownloadFile(string fileId, DriveService driveService)
{
var request = driveService.Files.Export(fileId, "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
var stream = new System.IO.MemoryStream();
// Add a handler which will be notified on progress changes.
// It will notify on each chunk download and when the
// download is completed or failed.
request.MediaDownloader.ProgressChanged +=
(IDownloadProgress progress) =>
{
switch (progress.Status)
{
case DownloadStatus.Downloading:
{
Console.WriteLine(progress.BytesDownloaded);
break;
}
case DownloadStatus.Completed:
{
Console.WriteLine("Download complete.");
break;
}
case DownloadStatus.Failed:
{
Console.WriteLine("Download failed.");
break;
}
}
};
request.Download(stream);
using (FileStream file = new FileStream("file.doc", FileMode.Create, FileAccess.Write))
{
stream.WriteTo(file);
}
}
すぐにお返事いただきありがとうございますが、ドライブから直接ドキュメントをダウンロードしてダウンロードしたいと思います。 – user1621791