2012-01-29 145 views
0

中我使用XML-RPC.net 3和joeblog DLL在C#。一切都很好,但我不能創建併發送後置標籤到WordPress。 我可以創建類別,標題,摘錄,內容,cutomfields的帖子,但沒有成功創建後標籤。 它我的代碼:發送後標籤到WordPress XML-RPC

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中的標記?

是否有任何庫或代碼來創建後標籤?

感謝您的任何幫助。

回答

1

修復這個

public string[] categories; 
    public string title; 
    public string description; 
    public string mt_excerpt; 
    public customField[] custom_fields; 
    public string[] mt_keywords; 

newBlogPost.mt_keywords = new string []{ "t1","t2"};