将事件添加到谷歌日历和雅虎日历

时间:2011-05-08 11:32:33

标签: asp.net-mvc google-api yahoo

如何在asp.net中向Google日历和雅虎日历添加事件?

3 个答案:

答案 0 :(得分:1)

下载api,查看api。 http://code.google.com/apis/calendar/data/2.0/developers_guide_dotnet.html

请注意创建活动的部分 来自:http://code.google.com/apis/calendar/data/2.0/developers_guide_dotnet.html#CreatingSingle

  1. 对服务进行身份验证

  2. 创建活动

  3. EventEntry entry = new EventEntry();
    
    // Set the title and content of the entry.
    entry.Title.Text = "Tennis with Beth";
    entry.Content.Content = "Meet for a quick lesson.";
    
    // Set a location for the event.
    Where eventLocation = new Where();
    eventLocation.ValueString = "South Tennis Courts";
    entry.Locations.Add(eventLocation);
    
    When eventTime = new When(DateTime.Now, DateTime.Now.AddHours(2));
    entry.Times.Add(eventTime);
    
    Uri postUri = new Uri("https://www.google.com/calendar/feeds/default/private/full");
    
    // Send the request and receive the response:
    AtomEntry insertedEntry = service.Insert(postUri, entry);
    

答案 1 :(得分:1)

答案 2 :(得分:0)