Anyone know if its possible to add a post and upload images to a开发者_如何学JAVA wordpress blog (self hosted) via a .net application?
I see i could use XML-RPC.net to talk with the wordpress XML-RPC interface, but i see really few documentation and samples around.
You can use JoeBlogs library to access the API. Using that, working with the blog is very simple:
var blog = new WordPressWrapper("https://svicktest.wordpress.com/xmlrpc.php", "svicktest", "mypassword");
byte[] imageData = …;
var image = blog.NewMediaObject(new MediaObject { bits = imageData, name = "Plane.jpg", type = "image/jpeg"});
blog.NewPost(new Post { title = "Hello!", description = "Hello world! <img src=\"" + image.url + "\" />" }, true);
精彩评论