天天看点

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 服务进行互动。

有了这些功能,我们在应用中可以集成使用,可以节省自己的开发运维成本,对于大的商业应用,支付一定的费用也是比较合适的选择。 

其他语言的库参考:

继续阅读