C# Google日历API的start min参数值无效

C# Google日历API的start min参数值无效,c#,google-calendar-api,C#,Google Calendar Api,我使用的正是C语言中Google日历API中的示例: string calendarURI=this.calendarURI.Text; 字符串用户名=this.userName.Text; 字符串密码=this.passWord.Text this.entryList = new ArrayList(50); ArrayList dates = new ArrayList(50); EventQuery query = new EventQu

我使用的正是C语言中Google日历API中的示例: string calendarURI=this.calendarURI.Text; 字符串用户名=this.userName.Text; 字符串密码=this.passWord.Text

        this.entryList = new ArrayList(50); 
        ArrayList dates = new ArrayList(50); 
        EventQuery query = new EventQuery();
        CalendarService service = new CalendarService("CalendarSampleApp");

        if (userName != null && userName.Length > 0)
        {
            service.setUserCredentials(userName, passWord);
        }

        // only get event's for today - 1 month until today + 1 year

        query.Uri = new Uri(calendarURI);

        query.StartTime = DateTime.Now.AddDays(-28); 
        query.EndTime = DateTime.Now.AddMonths(6);


        EventFeed calFeed = service.Query(query) as EventFeed;
        Console.WriteLine(query.Uri);
这是从示例中复制的,但当我运行它时,我得到:

执行请求失败:

信息是什么

起始最小值参数的值无效:2010-11-19T23:58:20 01:00


我做错了什么?

您没有正确地对日期时间中的加号进行URL编码,a+表示URL中的空格

用url编码的等价物%2B替换plus,一切正常


我想问题已经自行解决了,现在我再也不会出现这样的错误了……

我不确定这是谷歌示例代码中的错误还是你的实现中的错误-错误不会出现在负时区中-不需要url编码。我该怎么做?EventQuery对象将为我解析参数,然后它将查询自身,但我无法操作此数据。。。