C# 如何使用XML RPC发布新帖子
我使用WordPressSharp库,但在文档中我找不到如何发布新文章。默认情况下,新条款是草案C# 如何使用XML RPC发布新帖子,c#,xml-rpc,C#,Xml Rpc,我使用WordPressSharp库,但在文档中我找不到如何发布新文章。默认情况下,新条款是草案 var post = new Post { PostType = "post", Title = "My Awesome Post", Content = "<p>This is the content</p>", PublishDateTime = DateTime.Now }; using (var client = new Wo
var post = new Post {
PostType = "post",
Title = "My Awesome Post",
Content = "<p>This is the content</p>",
PublishDateTime = DateTime.Now
};
using (var client = new WordPressClient(new WordPressSiteConfig {
BaseUrl = "http://mywordpress.com",
Username = "admin",
Password = "password",
BlogId = 1
}))
{
var id = Convert.ToInt32(client.NewPost(post));
}
添加此行:
Status = "publish";