我要在特定文件内容中添加文本。
我用过:
var file = await dataService.Files.Get(fileId).ExecuteAsync();
if (file == null)
{
throw new Exception(nameof(fileId));
}
using (var stream = new MemoryStream())
{
using (var sw = new StreamWriter(stream, Encoding.UTF8))
{
sw.Write(content); //there is a simple text like: bblablllbalblba
var request = dataService.Files.Update(file, fileId, stream, file.MimeType);
await request.UploadAsync();
}
}
,但似乎内容未更新/编写。我没有任何错误。
我错了吗?