var
Cookie : TStrings;
StrHtml :String;
begin
Cookie := TStringList.Create;
Cookie.Add('formhash = 4046509f');
Cookie.Add('referer = http://www.hi-pda.com/forum/pm.php?action=send');
Cookie.Add('loginmode = normal');
Cookie.Add('styleid = 1');
Cookie.Add('cookietime = 31536000');
Cookie.Add('username = juziling');
Cookie.Add('password = ju_zi_ling');
Cookie.Add('questionid = 0');
Cookie.Add('answer =');
IdHTTP1.CookieManage := IdCookieManager1;
IdHTTP1.Request.Referer := 'http://www.hi-pda.com/forum/pm.php?action=send';
StrHtml := IdHTTP1.Post ('http://www.hi-pda.com/forum/logging.php?action=login',Cookie); //返回的只是登录的页面,不是登录成功的页面或登录出错的页面
//StrHtml := IdHTTP1.Get('http://www.hi-pda.com/forum/pm.php?action=send') ; //这个页面因该是进入会员管理界面的,但也报没有登录的 我想如果Cookie内容我解析错误,至少要报一个错误界面阿,怎么返回的只是登录的页面?
我想做个论坛灌水机:),但坛子有限制最少灌水间隔为60S.我想修改Cookie的方式用多用户轮流发帖来解决。不知这样可否?
Cookie : TStrings;
StrHtml :String;
begin
Cookie := TStringList.Create;
Cookie.Add('formhash = 4046509f');
Cookie.Add('referer = http://www.hi-pda.com/forum/pm.php?action=send');
Cookie.Add('loginmode = normal');
Cookie.Add('styleid = 1');
Cookie.Add('cookietime = 31536000');
Cookie.Add('username = juziling');
Cookie.Add('password = ju_zi_ling');
Cookie.Add('questionid = 0');
Cookie.Add('answer =');
IdHTTP1.CookieManage := IdCookieManager1;
IdHTTP1.Request.Referer := 'http://www.hi-pda.com/forum/pm.php?action=send';
StrHtml := IdHTTP1.Post ('http://www.hi-pda.com/forum/logging.php?action=login',Cookie); //返回的只是登录的页面,不是登录成功的页面或登录出错的页面
//StrHtml := IdHTTP1.Get('http://www.hi-pda.com/forum/pm.php?action=send') ; //这个页面因该是进入会员管理界面的,但也报没有登录的 我想如果Cookie内容我解析错误,至少要报一个错误界面阿,怎么返回的只是登录的页面?
我想做个论坛灌水机:),但坛子有限制最少灌水间隔为60S.我想修改Cookie的方式用多用户轮流发帖来解决。不知这样可否?
http://community.csdn.net/Expert/topic/3866/3866773.xml?temp=.5550959
procedure AutoLogin(iDoc1:IHTMLDocument2);
var
spDisp: IDispatch;
j: integer;
iELC : IHTMLElementCollection ;
S2,sn : string;
HtmlInputEle : IHTMLInputElement;
HTMLFormEle : IHTMLFormElement;
IF_Have:Boolean;
begin
if iDoc1 <> nil then
begin
ielc:=idoc1.Get_all;
for j:=0 to ielc.length-1 do
begin
Application.ProcessMessages;
spDisp := ielc.item(J, 0);
if SUCCEEDED(spDisp.QueryInterface(IHTMLInputElement ,HtmlInputEle))then
begin
HTMLFormEle :=HtmlInputEle.form;
IF_Have:=true;
with HtmlInputEle do
begin
S2:=Type_;
S2:=UpperCase(S2);
if StrComp(PChar(S2),'TEXT')=0 then
begin
sn := name;
sn := UpperCase(sn);
if StrComp(PChar(sn),'U')=0 then
value :='12313';
end;
if StrComp(PChar(S2),'PASSWORD')=0 then
begin
sn := name;
sn := UpperCase(sn);
if StrComp(PChar(sn),'PSW')=0 then
value :='1213';
end;
end;
end;
end; //END FOR
if(IF_Have)then
HTMLFormEle.submit;
end;
end;