2012-07-04 65 views

回答

0

在樣品看看:
Getting Started with the .NET Client Library
在鏈接頁面的右側上面有顯示包含在Google Data API solution示例項目的屏幕截圖。他們證明是非常有幫助的(我用它們來創建我自己的Google日曆應用程序)。

我建議保持您自己的解決方案和樣品解決方案打開。這樣你可以在示例和你自己的實現之間切換。

我也建議使用NuGet包:

  • Google.GData.AccessControl
  • Google.GData.Calendar
  • Google.GData.Client
  • Google.GData.Extensions
  • and more ...

這樣你可以輕鬆地保持最新狀態。


樣品,以獲得用戶的日曆:

public void LoadCalendars() 
{ 
    // Prepare service 
    CalendarService service = new CalendarService("Your app name"); 
    service.setUserCredentials("username", "password"); 

    CalendarQuery query = new CalendarQuery(); 
    query.Uri = new Uri("https://www.google.com/calendar/feeds/default/allcalendars/full"); 
    CalendarFeed calendarFeed = (CalendarFeed)service.Query(query); 

    Console.WriteLine("Your calendars:\n"); 
    foreach(CalendarEntry entry in calendarFeed.Entries) 
    { 
     Console.WriteLine(entry.Title.Text + "\n"); 
    } 
} 
+1

我知道這一個。但問題是我不想從用戶那裏獲取密碼和用戶名。我希望他們在Google上進行身份驗證,然後Google向我發送令牌,我想使用令牌併發出請求。有什麼方法可以使用令牌並獲取日曆提要? – Jaggu

相關問題