注册 登录
编程论坛 VB6论坛

winhttp post登陆的问题

猎人seo 发布于 2015-01-29 11:26, 579 次点击
Private Sub Command2_Click()

Const username As String = "seo123www"
Const password As String = "qazwsx123"

Dim vcode As String     '验证码
With CreateObject("winhttp.winhttprequest.5.1")
    .Open "GET", "http://bbss. & Int(1000 * Rnd), False
        .send
    vcode = Text3.Text  '取出返回的验证码值,动态值,可自动识别,也可手动输入
    .Open "POST", "http://bbss., False
        .setrequestheader "Content-Type", "application/x-www-form-urlencoded"
        .send "backurl=http%3A%2F%2Fbbss. & username & "&txtPassword=" & password & "&safecode=&randomcode=" & vcode & "&x=44&y=14"
     'Debug.Print .responsetext
     Debug.Print "backurl=http%3A%2F%2Fbbss. & username & "&txtPassword=" & password & "&safecode=&randomcode=" & vcode & "&x=44&y=14"
     If InStr(.responsetext, username) Then
        MsgBox "登录成功"
    Else
        MsgBox "登录失败"
    End If
End With


End Sub


登陆不成功,求各位大神帮你

[ 本帖最后由 猎人seo 于 2015-1-29 11:28 编辑 ]
1 回复
#2
风吹过b2015-01-29 14:59
这种复杂的东西,建议你老老实实用 WebBrowser 做吧。
winhttp 主要用来是读服务器上的东西。做别的,有些时候不好控制。
1