[帮助]如何HttpRequest点击网站上的按钮 [英] [HELP] how to HttpRequest to click button in website

查看:292
本文介绍了[帮助]如何HttpRequest点击网站上的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨伙计..

我有简单的客户

我需要使用httprequest将此信息发送到此页面

i need using httprequest to send this informations to this page

http://alsobhalmustanir.org/report

推荐答案

我尝试写:

    Function SendData(ByVal username As String, ByVal email As String, ByVal msgtitle As String, ByVal msgbody As String) As String
        Dim Request As HttpWebRequest = HttpWebRequest.Create("http://alsobhalmustanir.org/report/")
        Request.Method = "POST"
        Request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; rv:54.0) Gecko/20100101 Firefox/54.0"
        Request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
        Request.Headers.Add("Accept-Language: en-US,en;q=0.5")
        Request.ContentType = "application/x-www-form-urlencoded"
        Request.Referer = "http://alsobhalmustanir.org/report/"
        Dim PostData As String = "username=" & username & "email=" & email & "msgTitle=" & msgtitle & "msgItSelf=" & msgbody & "submit="
        Dim ByteArray As Byte() = Encoding.Default.GetBytes(PostData)
        Dim DataStream As Stream = Request.GetRequestStream()
        DataStream.Write(ByteArray, 0, ByteArray.Length)
        DataStream.Close()
    End Function

但不起作用,请帮助


这篇关于[帮助]如何HttpRequest点击网站上的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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