【发布时间】:2018-06-29 15:38:04
【问题描述】:
我正在开发电子邮件应用程序以读取来自 Gmail 的特定邮件,因为我正在使用以下代码。
using (var stream = new FileStream(userCredentialLocation + CredentialsJasonFile, FileMode.Open, FileAccess.Read))
{
string credPath = userCredentialLocation;
credPath = Path.Combine(credPath, ".credentials/gaf-gSuite.json");
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets, Scopes, "user", CancellationToken.None,
new FileDataStore(credPath, true)).Result;
Console.WriteLine("Credential file saved to: " + credPath);
}
但它正在启动 Gmail 应用程序以提供访问权限,但我想跳过人工交互,例如提供命令行访问权限。
请任何人帮助我。
【问题讨论】: