我试图通过控制台应用程序和c#访问我的谷歌驱动器帐户。 我按照指示: https://developers.google.com/drive/v3/web/quickstart/dotnet 和应用程序编译就好了。 第一次运行应用程序时,调试器问我GoogleClientSecrets.cs在哪里。我点击取消。 现在每次我打电话:Google GoogleClientSecrets.Load失败
var d = GoogleClientSecrets.Load(new FileStream("client_secret.json", FileMode.Open));
我得到如下对象返回:
d:
Installed null Google.Apis.Auth.OAuth2.ClientSecrets
Secrets 'd.Secrets' threw an exception of type 'System.InvalidOperationException' Google.Apis.Auth.OAuth2.ClientSecrets {System.InvalidOperationException}
Web null Google.Apis.Auth.OAuth2.ClientSecrets
,因为该方法GoogleWebAuthorizationBroker.AuthorizeAsync失败,当然还有。 我已经打开谷歌仪表板的API和json文件(client_secret.json)确实存在于正在运行的二进制文件的目录中。
关于如何使加载函数有效的建议?