2012-04-13 72 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); 
    } 
}