我使用 XMLRPC 将线程发布到 Wordpress (3.5.2) 这是我的代码:
public string newPost(string title, string content, string[] categoryIds)
{
this.Url = this.url ;
Post post = new Post();
post.post_date = DateTime.Now;
post.post_title = title;
post.post_content = content;
post.post_status = "publish";
XmlRpcStruct terms = new XmlRpcStruct();
terms.Add("category", categoryIds);
post.terms = terms;
return newPost("0", this.username, this.password, post, true);
}
[XmlRpcMethod("wp.newPost ")]
public string newPost(string blogId, string username, string password, Post content, bool pubish)
{
string s = "";
try
{
s = (string)this.Invoke("newPost", new object[] { blogId, username, password, content, pubish });
}
catch (Exception ex)
{
s = ex.Message;
}
return s;
}
但是当我从 adnin 检查那个帖子时,它显示“预定”
任何想法?谢谢你。