Google Calendar API: how to get CalendarEntry for default calendar?

I am trying to get the “normal” URL for the default calendar for users (for example, http://www.google.com/calendar/feeds/ jo@gmail.com / private / full ). I would like to use part of the jo@gmail.com URL as a unique identifier for this calendar.

I know that I can do something with the default calendar using the URL http://www.google.com/calendar/feeds/default/private/full . However, I cannot find a way to create CalendarEntry from this URL (I could then try SelfUri and some other properties to see where the “normal” URL is) or convert it to a “normal” URL anyway.

And I know that I can get a list of calendars as follows:

CalendarQuery query_cal = new CalendarQuery();
query_cal.Uri = new Uri( "http://www.google.com/calendar/feeds/default/allcalendars/full" );
CalendarFeed resultFeed = (CalendarFeed) service.Query( query_cal );
foreach ( CalendarEntry entry in resultFeed.Entries )
{ ... }

However, I cannot find a way to find out which of these entries corresponds to the default calendar.

Or any other way to get this normal default calendar URL.

+5
source share
2 answers

, , , :

    feedstring = resultfeed.Entries.Item(calendarIndex).Id.AbsoluteUri.Substring(63)
                postUristring = "https://www.google.com/calendar/feeds/" & feedstring & "/private/full"

Dim postUri As New Uri(postUristring)

calendarIndex = 0 . #!

+3

, ! ! :


        CalendarQuery query = new CalendarQuery();
        query.Uri = new Uri("https://www.google.com/calendar/feeds/default/allcalendars/full");
        CalendarFeed resultFeed = (CalendarFeed)service.Query(query);
        int calendarIndex = 0;
        string postUristring = string.Empty;
        foreach (CalendarEntry entry2 in resultFeed.Entries)
        {
            if (entry2.Title.Text == "My Pregnancy Calendar")
            {
                string feedstring = resultFeed.Entries[calendarIndex].Id.AbsoluteUri.Substring(63);
                postUristring = "https://www.google.com/calendar/feeds/" + feedstring + "/private/full";
            }
            calendarIndex++;
        }
+2

All Articles