28,391
社区成员
发帖
与我相关
我的任务
分享
<form name='leftForm' id="leftForm" method='post' action='http://192.168.1.101/post.asp' onSubmit="javascript:return checkLogin();">
<table width="500" border="0" cellspacing="5" cellpadding="0">
<tr>
<td align="right">帐号:</td>
<td><input type='text' name='rName' id='rName' class='w120' maxlength='10' /></td>
</tr>
<tr>
<td align="right">密码:</td>
<td><input type='password' name='password' id='password' class='w120 h16' maxlength='12' /></td>
</tr>
<tr>
<td height="35"><div align="center">验证码:
<input name="yzm" type="text" id="yzm" style="font-family: Verdana; font-size: 12px; width: 41; height: 21; border: 1px solid #336600; padding-left: 3px; padding-right: 3px; padding-top: 2px" size="20" maxlength="4" />
<img src="http://www.xxxxx.com/code.asp" alt="换一张" id="safecode" border="0" onclick="reloadcode()" style="cursor:pointer;padding:2px 8px 0pt 3px;" /><a href="javascript:reloadcode()">换一张</a></div></td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" class="button" value="登录" />
</td>
</tr>
</table>
</form>
<%
。。。。。。。。。。。。。。。。。。省略
On error resume next '容错处理
Function GetBody(ips)
Set https = Server.CreateObject("MSXML2.XMLHTTP")
With https
.Open "Post", "http://www.xxx.com/login.asp", False
.setRequestHeader "referer","http://www.xxx.com/login.asp"'
.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
.Send "username="&username&"&pass="&password&"&yzm="&yzm&""
GetBody = .ResponseBody
End With
GetBody = BytesToBstr(GetBody,"GB2312")
Set https = Nothing
End Function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Response.Write GetBody("")
%>