C# 我们可以使用GoogleDriveAPI创建具有多个工作表的google电子表格吗

C# 我们可以使用GoogleDriveAPI创建具有多个工作表的google电子表格吗,c#,google-sheets,google-drive-api,google-spreadsheet-api,google-sheets-api,C#,Google Sheets,Google Drive Api,Google Spreadsheet Api,Google Sheets Api,目前,我们正在使用DriveService创建电子表格。它创建具有单个工作表的电子表格。使用的代码如下: DriveService service = new DriveService(new BaseClientService.Initializer() { HttpClientInitializer = credential, ApplicationName = applicationName }); Google.Apis.Drive.v2.Data.File body = new Go

目前,我们正在使用DriveService创建电子表格。它创建具有单个工作表的电子表格。使用的代码如下:

DriveService service = new DriveService(new BaseClientService.Initializer() { HttpClientInitializer = credential, ApplicationName = applicationName }); 
Google.Apis.Drive.v2.Data.File body = new Google.Apis.Drive.v2.Data.File();
body.Title = uploadSpreadsheetRequest.FileName;
body.Description = uploadSpreadsheetRequest.FileName;
body.MimeType = "text/csv";
byte[] byteArray=System.IO.File.ReadAllBytes(uploadSpreadsheetRequest.FilePath);
System.IO.MemoryStream stream = new System.IO.MemoryStream(byteArray);
FilesResource.InsertMediaUpload request = service.Files.Insert(body, stream, "text/csv");
request.Convert = true;
request.Upload();
有没有办法,我可以修改我的代码来创建一个包含多个工作表的电子表格

我可以通过使用GoogleSheetsAPI实现这一点,但我希望通过使用字节实现这一点


有人能帮我解决这个问题吗。

我能解决这个问题。我曾经创建过包含多个工作表的excel文件,然后通过将内容类型设置为“application/vnd.ms excel”使用google drive上传该文件


在生产服务器上没有安装Microsoft Excel时使用NOPI。

我不这么认为。请注意,您可能想查看Google Drive api的V3,但没有理由真正使用旧版本。