Я пытаюсь добавить события в свой календарь. < /p>
Мне нужны специальные разрешения на мои календари? string[] scopesCal = new string[] { CalendarService.Scope.Calendar, // Manage your calendars
CalendarService.Scope.CalendarReadonly, // View your Calendars
};
var certificate = new X509Certificate2( @"GigaNetLibGoogleXCalendar.p12", "notasecret", X509KeyStorageFlags.Exportable );
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer( ServiceAccountEmail ) {
Scopes = scopesCal
}.FromCertificate( certificate ) );
// Create the service.
CalSrv = new CalendarService( new BaseClientService.Initializer() {
HttpClientInitializer = credential,
ApplicationName = "XCalendar",
} );
var calendars = CalSrv.CalendarList.List().Execute().Items;
foreach ( CalendarListEntry entry in calendars )
Console.WriteLine( entry.Summary + " - " + entry.Id );
Подробнее здесь: https://stackoverflow.com/questions/334 ... -calendars
Google API V3 - не может получить список календарей ⇐ C#
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение