http://www.aa.com/aa.asp
我想使用winsock模仿form的post 或 get方式向asp程序发送请问应该怎么办???
thanks

解决方案 »

  1.   

    这是发送请求,你用程序把这段发过去就行了GET /index.asp HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
    Accept-Language: zh-cn
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Alexa Toolbar)
    Host: 127.0.0.1:5050
    Connection: Keep-Alive其中第一行中的index.asp就是你要请求的页面,可以更改
      

  2.   

    Option Explicit
    Dim xml As Object
    Private Sub Command1_Click()
       Call AccessNet
    End SubPrivate Sub AccessNet()
    On Error Resume Next
    Dim str1 As String
    Set xml = CreateObject("MSXML2.XMLHTTP")
    xml.open "POST", "http://yourWeb/handle.asp", Falsexml.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"xml.send "UserName=" & Text1.Text & "&Password=" & Text2.textIf xml.Status = 200 Then
       str1 = StrConv(xml.responseBody, vbUnicode)'返回的内容
       MsgBox str1
    End If
    End Sub