gpt4 book ai didi

c# - 如何使用博客文章附加图像 - Google Blogger API - C# - VB.Net

转载 作者:行者123 更新时间:2023-11-30 15:32:16 25 4
gpt4 key购买 nike

我正在使用此代码在 Blogger 上创建新帖子,但我正在搜索如何在我们的帖子中附加和上传图片。

Imports Google.GData.Blogger
Imports Google.GData.Client

Dim service As New BloggerService("<my apps name>")
service.Credentials = New GDataCredentials("<email>", "<apps password>")
Dim newPost As AtomEntry = New AtomEntry()
newPost.Title.Text = "Test Title"
newPost.Content = New AtomContent()
newPost.Content.Content = "<h2>Test HTML Content</h2>"
newPost.Content.Type = "html"
Dim response As AtomEntry = Nothing

Dim blogFeedUri As Uri = New Uri("http://www.blogger.com/feeds/" + "<blog ID here>" + "/posts/default")
response = service.Insert(blogFeedUri, newPost)

最佳答案

更新

PicasaWeb API 已停用并由 Google 相册库取代。开始使用 here .如果您从 PicasaWeb API 迁移,请检查以下 Migration guide .

原始答案

没有直接的方法。上传到 Blogger 的图片首先上传到 Picasaweb。因此,您需要处理 Picasa 和 Blogger API。

您可以尝试以下步骤:

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

关于c# - 如何使用博客文章附加图像 - Google Blogger API - C# - VB.Net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19348829/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com