天天看點

Google APIs .net 用戶端庫初體驗

今天看到google api .net庫的釋出這條消息, 初步看了一下相關的内容,這個庫對.net程式員和google服務的互動很是友善。

這些代碼使用很是友善,具體步驟如下:

1、在 https://code.google.com/apis/console/#:access 或者

https://code.google.com/apis/console/b/0/#:access 擷取oAuth認證資訊和KEY

2、同時在以上位址開通相關的服務【否則不能使用,注意有收費的應用,免費的有次數限制】

3、代碼中加入以上的資訊,如下: 

        /// The OAuth2.0 Client ID of your project.

        public static readonly string ClientID = "<Enter your ClientID here>";

        /// The OAuth2.0 Client secret of your project.

        public static readonly string ClientSecret = "<Enter your ClientSecret here>";

        /// Your Api/Developer key.

        public static readonly string ApiKey = "<Enter your ApiKey here>";

4、編譯例子程式可以體驗Task(Tasks.WPF.ListTasks),Books(Books.ListMyLibrary)等各種應用

【注意:有些服務像Translate,以前都是免費的現在都收費了】

對于目前沒有提供的服務,可以通過Gdata(google Data API)和服務互動 

Google Data API 提供用于在網絡上讀寫資料的簡單、标準協定。 Google 資料 API 可以使您的用戶端應用程式與 Google 服務進行互動。

有了這些功能,我們在應用中可以內建使用,可以節省自己的開發運維成本,對于大的商業應用,支付一定的費用也是比較合适的選擇。 

其他語言的庫參考:

繼續閱讀