HttpWebRequest遇到的问题 [英] HttpWebRequest Problems encountered

查看:89
本文介绍了HttpWebRequest遇到的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在做一个小项目,

我在httpwebrequest中遇到问题.

我已经解决了登录特定网站的应用程序,但是
问题是我试图在我自己的wordpress网站上发布.但不会发送数据

Hello guys, i was making a small project,

i have a problem in httpwebrequest.

i have solved the applications to login to a certain sites, but
the problem is i am trying to post on my own wordpress site. but it won''t send data

Dim postData As String = "author=" & txtUser.Text & "&email=" & txtEmail.Text & "&url=" & txtWebsite.Text & "&comment=" & txtMessage.Text & "&submit"
'If i try this as Post Data, it wont let me post to my wordpress site. it returns nothing.
'If it try this 
' "author=" & txtUser.Text & "&email=" & txtEmail.Text & "&url=" & txtWebsite.Text & "&comment=" & txtMessage.Text & "&submit=&comment_post_ID=" & tempInt '- it returns me 'as code 500, Internal Server error.

    Dim tempcookies As New CookieContainer
    Dim encoding As New UTF8Encoding
    Dim byteData As Byte() = encoding.GetBytes(postData)
    Dim postreq As HttpWebRequest = DirectCast(HttpWebRequest.Create("http://myurl.com/wp-comments-post.php"), HttpWebRequest)
    postreq.Method = "POST"
    postreq.KeepAlive = True



有人可以帮我吗?



can anyone help me with this?

推荐答案

*不知道这是答案还是评论*

导航到您网站上的url:/wp-admin/options-writing.php.向下滚动,您将在此页面上看到用电子邮件写"(或其他名称)部分.此处的更多信息: http://codex.wordpress.org/Post_to_your_blog_using_email [
*Don''t know it''s an answer or comment*

Navigate to url on your site: /wp-admin/options-writing.php. Scroll down and you will see "Write with e-mail"(or another name) section on this page. More info here: http://codex.wordpress.org/Post_to_your_blog_using_email[^]

Then you can send an email from that address. If you need more information about how to send an email using C# please let me know. :)


这篇关于HttpWebRequest遇到的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆