如何解决使用xml-rpc的多个wordpress帖子
我想从我所拥有的帖子列表中发布多个帖子(总共168个)。我在简单的winforms应用程序的listview控件中创建一个列表。然后,我遍历列表项以创建帖子。
第一个帖子成功完成,但随后wordpress似乎阻止了下一个帖子,提示“用户名和密码不正确”。我已经尝试过多次连续发布,以至于该网站因安全措施阻止了我。
如何登录并一次性发布所有这些文章?
代码是:
public interface IgetCatList
{
[CookComputing.XmlRpc.XmlRpcMethod("metaWeblog.newPost")]
string NewPost(int blogId,string strUserName,string strPassword,blogInfo content,int publish);
}
private void PostArticle()
{
IgetCatList categories = (IgetCatList)XmlRpcProxyGen.Create(typeof(IgetCatList));
XmlRpcClientProtocol clientProtocol = (XmlRpcClientProtocol)categories;
clientProtocol.Url = "https://WEBSITEADDRESS.com/xmlrpc.php";
string result = null;
result = "";
try
{
result = categories.NewPost(1,userName,password,newBlogPost,1);
MessageBox.Show("Posted to Blog successfullly! Post ID : " + result);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。