.net 谷歌日历-从特定日历获取事件

.net 谷歌日历-从特定日历获取事件,.net,events,google-calendar-api,.net,Events,Google Calendar Api,我希望这将是相对容易的人谁熟悉谷歌日历API,做了一些搜索,但API没有给我答案 假设一个Google帐户有3个日历,都是由该用户创建的 我正在尝试使用.NET Google API从该用户的特定日历获取事件,如下所示: Calendar.userName = CalendarUserName; Calendar.userPassword = CalendarPassword; Calendar.feedUri = "https://www.google.com/cale

我希望这将是相对容易的人谁熟悉谷歌日历API,做了一些搜索,但API没有给我答案

假设一个Google帐户有3个日历,都是由该用户创建的

我正在尝试使用.NET Google API从该用户的特定日历获取事件,如下所示:

    Calendar.userName = CalendarUserName;
    Calendar.userPassword = CalendarPassword;
    Calendar.feedUri = "https://www.google.com/calendar/feeds/default/private/full";
这给了我来自所有日历的所有事件的提要,这一切都很好,但我需要解析它们(可能有一种方法可以识别,但我也不知道)

对我来说,最理想的是能够挑选并要求一个特定的日历,并且只从那个日历中获取活动

可能吗?是否只能使用魔法cookie请求

谢谢
邓肯你读过这本吗

这个呢

这是理解它的关键部分,我认为:

注意:其中一些代码片段显示 将事件添加到默认日历 或发送到特定用户的主服务器 日历(替换gmail地址) 对于POST中的“默认”字符串 URI),但也可以将事件添加到 非主日历也是如此。做 这样,您只需要日历ID 可以从 allcalendars提要,也将显示 在的“日历设置”页面中 用户界面。此id将再次在提要中使用 URI:

将singleUseToken设置为String=Request.getString(“令牌”)
Session(“sessionToken”)=AuthSubUtil.exchangeForSessionToken(singleUseToken,Nothing)
Dim authFactory As GAuthSubRequestFactory=新的GAuthSubRequestFactory(“cl”,“LeaveCalendar”)
authFactory.Token=Session(“sessionToken”).ToString
Dim service As service=新服务(“cl”,authFactory.ApplicationName)
service.RequestFactory=authFactory
Dim查询作为新日历查询()
query.Uri=新Uri(“https://www.google.com/calendar/feeds/default/owncalendars/full")
Dim resultFeed As AtomFeed=CType(service.Query(Query),AtomFeed)
对于resultFeed.Entries中作为原子的每个条目
Response.Write(“您的日历:”&entry.Title.Text)
响应。写入(“
”) Response.Write(“
日历id”&entry.SelfUri.ToString.Substring(64)) 下一个
我尝试了那个链接,但总是收到错误,关于Atom的东西的例外。 我稍微修改了一下代码,特别是以下两行:

1) Dim resultFeed As AtomFeed=CType(service.Query(Query),AtomFeed)

2) 对于resultFeed.Entries中作为原子的每个条目


我希望它能帮助其他VB.NET用户

,因此我请求的提要应该是:?我的理解是魔法饼干会在上面的私人部分…嗯,还是有点困惑!不管怎样,我想我只会使用魔法饼干版本,因为它会让我得到我想要的日历。
Dim singleUseToken As String = Request.getString("token")

        Session("sessionToken") = AuthSubUtil.exchangeForSessionToken(singleUseToken, Nothing)

        Dim authFactory As GAuthSubRequestFactory = New GAuthSubRequestFactory("cl", "LeaveCalendar")
        authFactory.Token = Session("sessionToken").ToString
        Dim service As Service = New Service("cl", authFactory.ApplicationName)
        service.RequestFactory = authFactory

        Dim query As New CalendarQuery()
        query.Uri = New Uri("https://www.google.com/calendar/feeds/default/owncalendars/full")
        Dim resultFeed As AtomFeed = CType(service.Query(query), AtomFeed)  

        For Each entry As AtomEntry In resultFeed.Entries
            Response.Write("Your calendar:" & entry.Title.Text)
            Response.Write("<br>")
            Response.Write("<br>Calendar id " & entry.SelfUri.ToString.Substring(64))   
        Next