2012-04-13 73 views
0

您可以通过代码示例告诉我如何编写C#程序,该程序将调用Google的Google + API和Google自定义搜索API的
c#程序可以通过Google调用Google+ API和自定义搜索API

我知道有它在:::::

URL简要说明:HTTPS://developers.google.com/+/api/
网址:https://开发商.google.com /自定义搜索/ V1/using_rest
的URL:http://code.google.com/p/google-api-dotnet-client/wiki/OAuth2

但记载的方法在做文件中给出的上述链接是
不是很清楚。
是否有通过C#代码进行简单说明,可用于调用Google+ API和自定义
Search API?

回答

0

Google API Dotnet Client project包含大部分Google的API including Google+的.NET包装器。

他们确实有several examples,但不是所有的API。

从他们的网页来查询公共活动

必须使用Google+的例子是:

CommandLine.EnableExceptionHandling();    
CommandLine.DisplayGoogleSampleHeader("PlusService API");  

// Create the service.    
var objService= new PlusService(); 
objService.Key = ""; //put in user key. 

var acts = objService.Activities.Search(); 
acts.Query = "super cool"; 
acts.MaxResults = 10; 

var searchResults = acts.Fetch(); 

if (searchResults.Items != null) 
{ 
    foreach (Activity feed in searchResults.Items) 
    { 
     //extract any property of uer interest 
     CommandLine.WriteResult(feed.Title, feed.Actor); 
    } 
}