当前位置:主页>销售管理软件> 列表

下面是我写的论坛自动登陆代码,但总是登陆不成功,不知道问题 找服装零售软件

库存管理软件版1楼: 下面是我写的论坛自动登陆代码,但总是登陆不成功,不知道问题出在哪里?
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdHTTP;

type
TForm1 = class(TForm)
Button1: TButton;
IdHTTP: TIdHTTP;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
const
BaseURL = ''http://bbs.hangzhou.com.cn/''; //论坛所在地址
UserName = ''''; //登录用户名
Password = ''''; //登录密码
var
Params: TStrings;
HTML: String;
MD5Pass: String;
p1,p2: Integer;
begin
Params:=TStringList.Create;
Params.Add(''username=''+UserName);
Params.Add(''password=''+Password);
Params.Add(''cookietime=''+InttoStr(CookieNone));

Params.Add(''comeurl=''+BASEURL+''logging.php?action=login'');
HTML:=IdHttp.Post(BaseURL+''logging.php?action=login'',Params);
if Pos(BASEURL+''index.php'',HTML)=0 then
begin
ShowMessage(''登录失败'');
Exit;
end
else
ShowMessage(''登陆成功'');
end;
end.

2楼: 自顶 如服装零售软件

3楼: 你能拿到你要登陆的那个论坛的代码吗.就是logging.php的.

4楼: 有人回答吗?

5楼: 你提交的有问题吧!
我对delphi不是很了解!
但是最起码的你提交的地址有问题!
登陆的页面是什么?

6楼: 你拦截一下用ie登录时发送的包,再模拟发出,是否用cookie了等信息。

库存管理软件版7楼: 请指教

8楼: who能回答我啊

9楼: 论坛有随机数,图片验证

10楼: 你看看发出的数据:
formhash=242bdcad&referer=index.php&loginmode=&styleid=&cookietime=2592000&loginfield=username&username=asd&password=asd&questionid=1&answer=asd&loginsubmit=%CC%E1+%26nbsp%3B+%BD%BB

你才发了其中的3项,怎么登陆?要模拟也得吧数据搞全呀

11楼: 看看这个,也许有帮助你理解:
http://www.5iv.net/070/how120047.htm