安装:
根据这个Quick start:https://developers.google.com/gmail/api/quickstart/dotnet
根据这个Quick start:https://developers.google.com/gmail/api/quickstart/dotnet
权限问题:
static string[] Scopes = { GmailService.Scope.GmailReadonly };
这句代码说明了权限只局限于Read email only,每次运行代码都会先检查权限文件C:\Users\KK\Documents\.credentials(自动生成,如果存在就会Cache)
如果要修改权限,比如改成
tatic string[] Scopes = { GmailService.Scope.GmailReadonly, GmailService.Scope.GmailModify, GmailService.Scope.GmailLabels};
运行代码前先要删除权限文件,因为默认下,它被cached了。