在vb 6.0中我使用下面的API函数访问网页:
InternetOpen '打开internet,返回一个句柄
InternetConnect ‘连接
HttpOpenRequest ‘打开请求
HttpSendRequest ‘提交request这个步骤对很多网站都可以提交请求,但现在我遇到一个网站,网站有一个非永久性的cookie: ASP.NET_SeesionID,
然后程序执行到HttpSendRequest后返回的响应是‘500’错误,请问HttpSendRequest如何提交cookie?提交请求时候我做了下面尝试 ,但还是有问题,求高手指点,谢谢 ...lpszPostData = strPost 'strPost 是我post的表单数据
'Init post parameter's length
lPostDataLen = Len(lpszPostData)
'StrCookie 是网站返回的ASP.NET_SeesionID的值
sHeaders = "Content-Type: application/x-www-form-urlencoded" & vbCrLf & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" & vbCrLf & "Proxy-Connection:Keep-Alive" & vbCrLf & "Cookie:" & StrCookie
lHeadersLength = Len(sHeaders)
'Send request
bRet = HttpSendRequest(hHttpOpenRequest, _
    sHeaders, _
    lHeadersLength, _
    lpszPostData, _
    lPostDataLen)