Tag: google calendar api

对“C:\ Windows \ system32 \ config \ systemprofile”路径的访问被拒绝

我正在使用Google Calendar Api和我的一个项目。 我不知道如何,但下面显示的错误是令人不安的。 AppFlowMetadata代码。 public class AppFlowMetadata : FlowMetadata { private static readonly IAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow(new GoogleAuthorizationCodeFlow.Initializer { ClientSecrets = new ClientSecrets { ClientId = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com”, ClientSecret = “xxxxx_xxxxxxxxxxxxxxxxx” }, Scopes = new[] { CalendarService.Scope.Calendar }, DataStore = new FileDataStore(“Calendar.Api.Auth.Store”) }); public override string GetUserId(Controller controller) { var user = controller.Session[“UserID”]; if […]

为什么我在Google Calendar API中收到(401)未经授权的错误

我一直在使用谷歌日历API,并陷入困境。 当我在下面调用它来删除日历事件时,它在第一遍和第二阶段正常工作。 但是,在第二次或第三次我称这种方法时,我得到(401)未经授权的错误 。 它每次都使用相同的凭据。 如果我得到exception,我可以重置 catch中的凭据 ,它可以正常工作。 我宁愿不要这样做。 有任何想法吗? CalendarService myService = new CalendarService(“mycompany-myapp-1”); myService.setUserCredentials(“jo@username.com”, “password”); // set the query for the event EventQuery myQuery = new EventQuery((“http://www.google.com/calendar/feeds/jo@username.com/private/full”)); myQuery.Query = “Cut the grass”; myQuery.StartTime = DateTime.Now; myQuery.EndTime = DateTime.Now.AddDays(1); // find the event EventFeed myResultsFeed = null; try { // execute the query to […]

使用服务帐户身份validation访问Google Calendar API

我能够使用.NET快速入门教程访问Google Calendar API,效果很好! 该教程的问题在于它使用Open Authentication or OAuth2 。 我想使用服务帐户身份validation执行相同操作。 ( https://support.google.com/googleapi/answer/6158857?hl=en ) 有人能举例说明如何使用服务帐户密钥文件访问我的日历吗? 我也试过尝试使用带有C#教程的Google Calendar API身份validation,但无法完成它。

Google C#Api Beta 1.6身份validation问题

尝试使用C#Beta v1.6 SDK对Google日历服务进行身份validation和访问时看起来不对 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Google.Apis.Auth.OAuth2; using Google.Apis.Auth; using Google.Apis.Authentication; using Google.Apis.Calendar.v3; using System.Threading; using Google.Apis; using Google.Apis.Services; var uc = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets() { ClientId = string.Empty, ClientSecret = string.Empty }, new[] { CalendarService.Scope.Calendar }, “user”, CancellationToken.None); var service = new CalendarService(new BaseClientService.Initializer() { HttpClientInitializer = […]

Google Calendar API v3 – 在服务器上部署时请求超时

我试图登录localhost,一切正常。 代码: public static bool LoginGoogleCalendar(string clientId, string clientSecret, string idGCalendarUser, string calendarServiceScope, string folder) { try { UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync( new ClientSecrets { ClientId = clientId, ClientSecret = clientSecret, }, new[] { calendarServiceScope }, idGCalendarUser, CancellationToken.None, new FileDataStore(folder)).Result; return true; } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return false; } } (我正确设置了fileDataStore的授权) 在Google Developers […]

使用带有.net framework 3.5的Google Calendar API V3

我正在使用一个使用.Net 3.5框架的Web应用程序。 它使用Google日历API V1。 在谷歌论坛中搜索时,发现Google日历API V1和V2已弃用,应使用V3。 Google Calendar API V3平台支持是.NET Framework 4和4.5 我们的应用程序应该升级到.NET framework 4还是4.5? 或者是否有任何解决方案在.Net 3.5框架中使用谷歌日历API?

如何在Google日历中创建“recurData”?

我想使用Google API创建日历的定期事件。 我正在关注链接: Google Calendar API 我没有得到如何创建“recurData”。 我无法修改String并将其作为参数传递。 尝试过DDay.iCal版本0.80。 也。 DDay.iCal 给出了一些示例代码。我尝试了它们。 我能够创建“.ics”文件。 但是当我将此文件内容作为“recurData”传递时 出错:{“执行请求失败: http : //www.google.com/calendar/feeds/user@domain.com/private/full? gsessionid = AHItK5wrSIoJVawFjGt- 0g ”} 我的icf文件内容是: BEGIN:VCALENDAR VERSION:2.0 PRODID:-//DDay.iCal//NONSGML ddaysoftware.com//EN BEGIN:VEVENT CREATED:20100309T132930Z DESCRIPTION:The event description DTEND:20100310T020000 DTSTAMP:20100309T132930Z DTSTART:20100309T080000 LOCATION:Event location SEQUENCE:0 SUMMARY:18 hour event summary UID:396c6b22-277f-4496-bbe1-d3692dc1b223 END:VEVENT BEGIN:VEVENT CREATED:20100309T132930Z DTEND;VALUE=DATE:20100315 DTSTAMP:20100309T132930Z DTSTART;VALUE=DATE:20100314 SEQUENCE:0 SUMMARY:All-day event UID:ac25cdaf-4e95-49ad-a770-f04f3afc1a2f END:VEVENT […]

Google日历redirect_uri_mismatch

我在Visual Studio Express 2012 for Web中有一个网站。 我一直收到谷歌的错误,当我尝试下面的代码时,开发者控制台中列出的重定向uri没有匹配: private void getEvents() { UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync( new ClientSecrets { ClientId = “CLIENTIDHERE”, ClientSecret = “SECRETHERE”, }, new[] { CalendarService.Scope.Calendar }, “user”, CancellationToken.None).Result; // Create the service. var service = new CalendarService(new BaseClientService.Initializer() { HttpClientInitializer = credential }); List x = service.Events.List(“primary”).Execute().Items.ToList(); } 我已经尝试在visual studio中将默认端口设置为8080,并且我在开发人员控制台中列出的URI如下所示: http://localhost:8080/QFC/Coach/Manageusers.aspx http://localhost:8080/QFC/* […]

如何创建定期日历活动?

我正在使用asp mvc 3,jquery完整日历,ms sql sever 2008和c#。 我想知道是否有人知道如何制作重复活动? 我不确定如何制作它们。 例如,在谷歌日历中,您可以永久地重复预约。 我怀疑他们在数据库中生成X次约会。 我想知道如何在我的数据库中有一行,并且知道如何在需要时调用它。 此外,谷歌日历和Outlook有很多重复选项,如重复在第1个月,上个月等。 有没有这样的库构建? 或者我是从头开始做的? PS 我在共享主机上,因此解决方案必须使用有限的权限。

如何使用Google Calendar API创建任务

我想使用Google Calendar API 在Google日历中创建任务。使用C#。 寻找一些示例代码。