=======================
<%
strName = "aa"
strPwd="bb"
Set x = Server.CreateObject("Microsoft.XMLHTTP")
str = "name=" & strName & "&pwd=" & strPwd
x.Open "POST","http://localhost/asp/Login.asp",False
x.setRequestHeader "Content-Length",Len(str)
x.setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
x.send str
If Trim(x.responseText) = "ok" Then
Response.Redirect "http://lucky_elove.www1.dotnetplayground.com/"
Else
Response.write "无效密码和名字"
End if
%>
Login.asp
=---------------
<%
If Request.Form("name") = "aa" And Request.Form("pwd") = "bb" Then
Response.write "ok"
Else
Response.write "fail"
End If
%>
function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Msxml2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then exit function
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function
Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function %>