我正在使用WordPressSharp并尝试将内容添加到我的wordpress博客中。
我在添加内容方面遇到了麻烦。
Helper.WordpressConfigurations.postToWordpress(1, "testing", "content description");
这是我的帖子方法
public static Post setPost(int postType, string title, string content)
{
string type = postType == 1 ? "post" : "page";
int categoryId = 0;
switch ("".ToLowerInvariant())
{
case "arrow": categoryId = 4; break;
default: categoryId = 0; break;
}
return new Post
{
PostType = "post", // "post" or "page"
Title = title,
Content = content,
PublishDateTime = DateTime.Now,
Status = "publish"//, // "draft" or "publish",
//Terms = terms
};
}
在WordpressClient.cs中有例外>
答案 0 :(得分:0)
WordPressSharp依赖于 xml-rpc.net 版本3.0.0,它还不是一个稳定的版本,似乎有bug。请尝试使用版本2.5.0。
它适用于我的情况,我希望它对你有所帮助。