我在C#中使用Google Calendar API中的确切示例: string calendarURI = this.CalendarURI.Text; string userName = this.UserName.Text; string passWord = 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);
这是从示例中复制的,但是当我运行它时,我得到:
消息是什么
start-min参数值无效:2010-11-19T23:58:20 01:00
我做错了什么?
答案 0 :(得分:0)
您在日期时间中对加号进行了正确的URL编码,而+
表示网址中的空格...
将plus替换为其url编码的等效%2B
,这一切都正常......
答案 1 :(得分:0)
我猜这个问题已经解决了,现在我再也没有得到这个错误......