var certificate = new X509Certificate2(DemelerResource.Sample_de2334d727a5, "notasecret", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(serviceAccountEmail)
{
Scopes = new[] { CalendarService.Scope.Calendar },
User = ".............@Sample.com"
}.FromCertificate(certificate));
// Create the service.
gService = new CalendarService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "App Sample",
});
//Code For Create Event
Event newEvent = new Event()
{
Summary = "Today ",
Location = "RoomAddress",
Description = "Today",
Organizer = User,
Start = new EventDateTime()
{
DateTime = DateTime.Now,
TimeZone = "America/Phoenix"
},
End = new EventDateTime()
{
DateTime = DateTime.Now.AddHours(1),
TimeZone = "America/Phoenix"
}
};
Event insertedEvent = gService.Events.Insert(newEvent, url).Execute();
Pls response me as soon as possible regarding this issue. Thanks