【发布时间】:2012-01-29 08:30:45
【问题描述】:
我在 C# 中使用 XML-RPC.net 3 和 joeblog dll。一切正常,但我无法创建帖子标签并将其发送到 WordPress。 我可以创建带有类别、标题、摘录、内容、剪切字段的帖子,但无法成功创建帖子标签。 这是我的代码:
public void createPost(newPost np)
{
loginformobject = new LoginForm();
string postid;
icp = (IcreatePost)XmlRpcProxyGen.Create(typeof(IcreatePost));
clientProtocol = (XmlRpcClientProtocol)icp;
clientProtocol.Url = url.Text;
try
{
postid = icp.NewPost(1, User.Text, Pass.Text, np, 1);
}
catch (Exception ex)
{
MessageBox.Show("createPost ERROR ->" + ex.Message);
}
}
private void button1_Click(object sender, EventArgs e)
{
customField newCustomField2 = default(customField);
newCustomField2.key = "Testttttttttttt";
newCustomField2.value = "testttvalye";
newPost newBlogPost = default(newPost);
newBlogPost.title = "Some Title<AliReza Test>";
newBlogPost.description = "Some description Test Test Test Test<AliReza Test>";
newBlogPost.custom_fields = new customField[] { newCustomField2 };
newBlogPost.categories = new string[] { "Test" };
newBlogPost.mt_excerpt = "Tozihate Kotah";
newBlogPost.mt_taxonomy = new string[] { "test","test2" };
createPost(newBlogPost);
}
如何在 C# 中的 XML-RPC 中发送带有标签的帖子?
是否有任何库或代码来创建帖子标签?
感谢您的帮助。
【问题讨论】: