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的方式用多用户轮流发帖来解决。不知这样可否?

解决方案 »

  1.   

    嘿嘿,我俩碰到的是一个问题哦,解决了别忘告诉一声啊!
    http://community.csdn.net/Expert/topic/3866/3866773.xml?temp=.5550959
      

  2.   

    看看就明白了
    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;
      

  3.   

    楼上的老大,你是用WebBrowser获得网页,在IHTMLDocument2(WebBrowser.Document)方式获得网页内容的。但这样你怎么处理该网页对应的Cookie? 我主要是为了修改Cookie....