1
16cy
Unregistered / Unconfirmed
GUEST, unregistred user!
我用了TIdhttp控件,向一个网页提交用户名和密码正常登陆后,返回的数据是:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="application/x-www-form-urlencoded">
<title>add infomation</title>
</head>
你是注册用户!
但是我只想要得到“你是注册用户!”这条信息,却给我返回一大堆,影响网速,请问如何解决这个问题?
部分代码如下:
GetURL := httpsrv.Text +'getinfo.asp'; {登录页面网址}
PostURL := httpsrv.Text +'getinfo.asp?name='+trim(encrypt(trim(name))); {提交网址}
sParams := 'password='+trim(EnCrypt(trim(password))); {提交参数}
showmessage(PostURL);
showmessage(sParams);
try
aParams.Clear;
aParams.Add(sParams);
GetHtml := IdHTTP1.Get(GetURL); {取登录页面}
IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
IdHTTP1.Post(PostURL, aParams, aStream); {提交}
showmessage(astream.DataString);
memo1.lines.Add(aStream.DataString);
memo1.SelectAll ;
finally
IdHTTP1.Free;
aParams.Free;
aStream.Free;
end;
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="application/x-www-form-urlencoded">
<title>add infomation</title>
</head>
你是注册用户!
但是我只想要得到“你是注册用户!”这条信息,却给我返回一大堆,影响网速,请问如何解决这个问题?
部分代码如下:
GetURL := httpsrv.Text +'getinfo.asp'; {登录页面网址}
PostURL := httpsrv.Text +'getinfo.asp?name='+trim(encrypt(trim(name))); {提交网址}
sParams := 'password='+trim(EnCrypt(trim(password))); {提交参数}
showmessage(PostURL);
showmessage(sParams);
try
aParams.Clear;
aParams.Add(sParams);
GetHtml := IdHTTP1.Get(GetURL); {取登录页面}
IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
IdHTTP1.Post(PostURL, aParams, aStream); {提交}
showmessage(astream.DataString);
memo1.lines.Add(aStream.DataString);
memo1.SelectAll ;
finally
IdHTTP1.Free;
aParams.Free;
aStream.Free;
end;