<%
Function GetResult(urlStr)
Dim xmlHttp
Dim retStr
Set xmlHttp = CreateObject("Msxml2.XMLHTTP") '创建对象
On Error Resume Next '出错处理
xmlHttp.Open "POST", urlStr, False '用POST方式打开连接,异步执行。
xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" '上传表单
'xmlHttp.Send "username=xiaoxiao&userpwd=111111&usercookies=0" '发送指令
xmlHttp.Send "username=bjyg&userpwd=111111&usercookies=0&act=chk" '发送指令
If Err.Number = 0 Then '如果连接正确
retStr = xmlHttp.responseText '等待并获得服务端返回的结果字符串
Else
retStr = "Url not found" '否则返回出错信息
End If
cookie1 = xmlHttp.getResponseHeader("Set-Cookie")
Response.write "cookie1="&cookie1
Set xmlHttp = nothing '释放对象 GetResult = retStr '返回结果
Response.Write retStr
End Function
'GetResult "http://www.wodezhaopin.com/login.asp"
GetResult "http://www.sxjobs.cn/company/login.php"
%>
评论