C# 将Google驱动器文件url转换为Google文档查看器

C# 将Google驱动器文件url转换为Google文档查看器,c#,google-api,C#,Google Api,我想上传一个HTML到谷歌驱动器,并获得网址。此代码上传良好,并返回文件的URL。但我想在谷歌文档查看器中获取文件URL。我怎么做到的 File body = new File(); body.Title = Path.GetFileNameWithoutExtension(item); //body.Description = "A test document"; body.MimeType = "text/html"; byte[] byteArray = System.IO.File.

我想上传一个HTML到谷歌驱动器,并获得网址。此代码上传良好,并返回文件的URL。但我想在谷歌文档查看器中获取文件URL。我怎么做到的

File body = new File();
body.Title = Path.GetFileNameWithoutExtension(item);

//body.Description = "A test document";

body.MimeType = "text/html";
byte[] byteArray = System.IO.File.ReadAllBytes(item);

var stream = new MemoryStream(byteArray);
FilesResource.InsertMediaUpload request = 
    service.Files.Insert(body, stream, "application/vnd.google-apps.document");

request.Convert = true;
request.Upload();
File file = request.ResponseBody;
var id = file.Id;