procedure TFrm_main.login(URL, TitleType, Title, webData: OleVariant);
var
Flags, TargetFrameName, PostData, Headers: OleVariant;
str: string;
l, i: integer;
begin
Panel_Hint.Visible := true;
str := 'B1=%CC%E1%BD%BB';
str := str + '&TType=';
str := str + HTTPEncode(TitleType);
str := str + '&TTitle=';
str := str + HTTPEncode(Title);
str := str + '&SMemo=';
str := str + HTTPEncode(webData);
URL := 'http://localhost/web/toAccess.asp';
l := length(str);
if l > 0 then
begin
PostData := VarArrayCreate([0, l - 1], varByte);
for i := 1 to l do
begin
PostData[i - 1] := ord(str
);
end;
end;
Flags := '0';
TargetFrameName := '';
Headers := 'Content-Type: application/x-www-form-urlencoded'#13;
WebBrowser_up.Navigate2(URL, Flags, TargetFrameName, PostData, Headers);
end;
procedure TFrm_main.WebBrowser_upNavigateComplete2(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
var
DoC: IHTMLDocument2;
str, id, fn: string;
j: integer;
begin
Panel_Hint.Visible := false;
Doc := WebBrowser_up.Document as IHTMLDocument2;
str := doc.body.outerText;
j := pos(#09, WebBrowser_up.hint);
if j > 0 then
begin
id := copy(WebBrowser_up.hint, 1, j - 1);
fn := copy(WebBrowser_up.hint, j + 1, MaxInt);
if sametext(trim(id + '验证通过'), trim(str)) then
begin
WillMark := true;
ShockwaveFlash1.Movie := fn;
ShockwaveFlash1.Play;
exit;
end;
end;
ShowMessage(fn + str);
//
end;
Post.asp〉〉〉〉〉〉〉〉〉〉〉〉〉〉〉〉〉
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>分类</title>
</head>
<body>
<form method="POST" action="toAccess.asp">
<p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p>
<p>用户</p>
<p><input type="text" name="TType" size="20"></p>
<p>密码</p>
<p><input type="text" name="TTitle" size="20"></p>
<p>ID</p>
<p><input type="text" name="SMemo" size="20"></p>
<p> </p>
<p> </p>
<p> </p>
</form>
</body>
</html>
/////////////////////
toAccess.asp
<html>
<head>
<title></title>
</head>
<body>
<%
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("." & "/webserver.mdb;"
set rs=server.createobject("adodb.recordset"
rs.open "select * from users,file where users.userID=file.userID and users.userID='"+request.form("TType"+"' and users.pass='"+request.form("TTitle"+"' and file.fileID='"+request.form("SMemo"+"'",objConn,1,1
'response.write "select * from users,file where users.userID=file.userID and users.userID='"+request.form("TType"+"' and users.pass='"+request.form("TTitle"+"' and file.fileID='"+request.form("SMemo"+"'"
if rs.eof and rs.bof then
response.write "验证未通过"
else
response.write request.form("SMemo"+"验证通过"
end if
Set rs = Nothing
Set objConn = Nothing
%>
</body>
</html>