如何使用博客post附加图像 – Google Blogger API – C# – VB.Net

我正在使用此代码在博客上创建新post,但我正在搜索如何使用我们的post附加和上传图像。

Imports Google.GData.Blogger Imports Google.GData.Client Dim service As New BloggerService("") service.Credentials = New GDataCredentials("", "") Dim newPost As AtomEntry = New AtomEntry() newPost.Title.Text = "Test Title" newPost.Content = New AtomContent() newPost.Content.Content = "

Test HTML Content

" newPost.Content.Type = "html" Dim response As AtomEntry = Nothing Dim blogFeedUri As Uri = New Uri("http://www.blogger.com/feeds/" + "" + "/posts/default") response = service.Insert(blogFeedUri, newPost)

没有简单的方法。 在Blogger上传的图片首先上传到Picasaweb。 因此,您需要使用picasa以及Blogger API。

您可以尝试以下步骤:

  1. 创建UI以从系统中选择图像。
  2. 使用Google Picasa API上传图片
  3. 获取上传图片的链接,并将其添加到您的Blogger HTML代码中。