XML-RPC service is used to send posts to WordPress blogs remotely. You can download the corresponding .NET library from here: http://xml-rpc.net
Add this library as a reference in your Visual Studio project. Then define it at the top of your code:
using CookComputing.XmlRpc;
The rest of the code is below.
public void wordpressPost() { blogInfo newBlogPost = default(blogInfo); newBlogPost.title = "This is title"; newBlogPost.description = "Post goes here"; IgetCatList categories = (IgetCatList)XmlRpcProxyGen.Create(typeof(IgetCatList)); XmlRpcClientProtocol clientProtocol = (XmlRpcClientProtocol)categories; clientProtocol.Url = "http://www.yourblog.com/xmlrpc.php"; //your blog address comes here string result = null; result = ""; result = categories.NewPage(1, "admin", //your blog admin user id "yourpassword", //your blog admin password newBlogPost, 1); } public struct blogInfo { public string title; public string description; } public interface IgetCatList { [CookComputing.XmlRpc.XmlRpcMethod("metaWeblog.newPost")] string NewPage(int blogId, string strUserName, string strPassword, blogInfo content, int publish); }
how to send image? (set featured image)
I would try to put HTML code for the image into newBlogPost.description variable
edit my comment: How to send image as Set Thumbnail Image to wordpress?
I also want to know how to send images with your post?
You can set images and media files using the WorkpressPCL nutget packages. Allow you to connect to WordPress website using the WordPress Rest Api. Check the detail in this link:
http://yeisonpx.com/software-develoment/conecting-to-wordpress-using-csharp/
Adding html to the description added a image to my post. should work for you guys also
here how can we get blog id ?