以编程方式将新日历添加到Google日历帐户 [英] Programmatically add new calendar to a Google Calendar Account

查看:113
本文介绍了以编程方式将新日历添加到Google日历帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从GUI添加新日历,这有可能吗?
我可以检索所有日历,但不知道如何添加.

I''m trying to add a new calendar from GUI, is it possible or not?
I can retrieve all calendars but don''t know how to add.

//Retrieve all calendars for an account
   private CalendarFeed RetrievingOwnGoogleCalendars()
   {
     CalendarService myService = new CalendarService("exampleCo-exampleApp-1");
     myService.setUserCredentials(textBoxUsrName.Text, textBoxPassword.Text);

     CalendarQuery query = new CalendarQuery();
     query.Uri = new Uri ("http://www.google.com/calendar/feeds/default/owncalendars/full");
     CalendarFeed resultFeed = myService.Query(query);
     return resultFeed;
    }



需要一种添加新方法的方法.



Need a method to add a new one.

推荐答案

我找到了答案;


I found the answer;


public CalendarEntry CreateCalendar(string title, string summary, string timezone, bool ispublic)
{
    CalendarEntry calendar = new CalendarEntry();
    calendar.Title.Text = title;
    calendar.Summary.Text = summary;
    calendar.TimeZone = timezone;


    Uri postUri = new Uri("https://www.google.com/calendar/feeds/default/owncalendars/full");
    CalendarEntry createdCalendar = (CalendarEntry) _calendarService.Insert(postUri, calendar);

    return createdCalendar;
}


我认为您无法从获得信息的方式中以给定的代码添加新数据.
但是,您可以使用Google提供的Google API来实现.
以下链接可能对您有帮助:
http://stackoverflow.com/questions/2150245/adding-an-event-to-a-specific-google-calender-with-gdata-api [ http://stackoverflow.com/questions/1534373/google-calendar-api-selecting- creation-calendars [ ^ ]

希望对您有帮助.

〜Amol
I don''t think you will be able to add new data from the way you are getting information is the code you have given.
But, you can do that using Google API''s provided by Google.
Following links may help you:
http://stackoverflow.com/questions/2150245/adding-an-event-to-a-specific-google-calender-with-gdata-api[^]
http://stackoverflow.com/questions/1534373/google-calendar-api-selecting-creating-calendars[^]

Hope this will help you.

~Amol


这篇关于以编程方式将新日历添加到Google日历帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆