【发布时间】:2014-05-28 10:23:26
【问题描述】:
我想使用 Google 服务帐户获取用户的 Google 日历列表和事件。
我正在尝试使用 CalendarService,但找不到解决方案。
我的代码:
string path = KeyPath;
X509Certificate2 certificate = new X509Certificate2(
path,
"notasecret", X509KeyStorageFlags.Exportable);
var provider = new AssertionFlowClient(GoogleAuthenticationServer.Description, certificate)
{
ServiceAccountId = "XXXXX@developer.gserviceaccount.com",
Scope = "http://www.google.com/calendar/feeds/default/private/full"
};
var auth = new OAuth2Authenticator<AssertionFlowClient>(provider, AssertionFlowClient.GetState);
var cService = new CalendarService(auth);
它显示错误 Calendarservice 有一些无效参数。我不知道如何处理这项服务。任何帮助将不胜感激。
【问题讨论】:
标签: c# asp.net google-api google-calendar-api google-apps