2013-10-08 160 views
4

這裏是Blogger的API V3頁面:https://developers.google.com/blogger/docs/3.0/using如何使用Blogger API V3

和下載的NuGet的Blogger API包:https://www.nuget.org/packages/Google.Apis.blogger.v2

我的開發環境是Visual Studio 2010中使用C#語言

如何我可以使用Blogger的API嗎?

我只是不明白他們在https://developers.google.com/resources/api-libraries/documentation/blogger/v3/csharp/latest/namespaces.html寫道...

如何初始化一個新的Blogger服務,並得到所有的文章列表?

在哪裏使用我的應用程序(ClientID和ClientSecret)進行身份驗證?

回答

3

您需要GDATA客戶端,因此您需要下載Google API。 立即下載here。您需要安裝該MSI,它會將dll,樣本添加到您的系統。

C:\ Program Files文件\谷歌\谷歌數據API SDK

  1. 添加Google.GData.Blogger.dll到項目
  2. 添加引用後,您可以使用此link以供參考。

以下代碼可用於創建服務並從Blogger獲取數據。

Service service = new Service("blogger", "blogger-example"); 
string username = "[email protected]"; 
string password = "abc143"; 
service.Credentials = new GDataCredentials(username, password); 
+0

不是真的,Google Blogger API v3不再使用GData – GaryNg

+0

@GaryNg:我懷疑。那它用了什麼?我最近使用API​​ 3開發了實用程序,並且我明確使用了Google.GData.Blogger.dll。我在這裏錯過了什麼? –

+0

也許是我的錯..不好意思.. – GaryNg