private void btnPost_Click(object sender, EventArgs e) { blogInfo newBlogPost = default(blogInfo); newBlogPost.title = txtTitle.Text; newBlogPost.description = txtPost.Text; categories = (IgetCatList)XmlRpcProxyGen.Create(typeof(IgetCatList)); clientProtocol = (XmlRpcClientProtocol)categories; clientProtocol.Url = "http://127.0.0.1/wpl/xmlrpc.php"; string result = null; result = ""; try { result = categories.NewPage(1, "shoban", "shoban", newBlogPost, 1); MessageBox.Show("Posted to Blog successfullly! Post ID : " + result); txtPost.Text = ""; txtTitle.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void ProcessDataWordpress(String url) { blogInfo newBlogPost = default(blogInfo); newBlogPost.title = Spinner.Spin(txtTitle.Text); newBlogPost.description = Spinner.Spin(editor1.BodyHtml); categories = (IgetCatList)XmlRpcProxyGen.Create(typeof(IgetCatList)); clientProtocol = (XmlRpcClientProtocol)categories; string linkwordpress = ""; string username = ""; string password = ""; string[] words = url.Split('|'); linkwordpress = words[0]; username = words[1]; password = words[2]; txtSite.Text = linkwordpress; txtUser.Text = username; txtPass.Text = password; clientProtocol.Url = "https://" + linkwordpress + "/xmlrpc.php"; string result = null; result = ""; try { result = categories.NewPage(1, username, password, newBlogPost, 1); //MessageBox.Show("Posted to Blog successfullly! Post ID : " + result); //txtPost.Text = ""; //txtTitle.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message); } }