俺在D7下使用IDHTTP来访问ASP页面,无法使用POST方法.以及如何得到返回的页面内容..
注ASP页面的登录框是FORM表单,直接在IE里输入http://www.xx.com/login.asp?uid=a&pwd=b都不行,必须填写表单按按钮才能进去,如何解决??????

解决方案 »

  1.   

    function TS_Login_form.Login:boolean;
    var
    post_var : TStringList;
    begin
      result := false;
      post_var := TStringList.Create;
      post_var.Add('user_name='+UserName.Text);
      post_var.Add('pass_word='+PassWord.Text);
      Login_states := http_Login_form.Post('http://12.0.0.152:99/Login.php',post_var);  if(Login_states =Login_success) then begin
       Login_Pop.MessageText:='登陆成功';
       Login_Pop.Popup;
       result :=true;
      end else begin
       Login_Pop.MessageText:='登陆失败';
       Login_Pop.StayTime:=22222;
       Login_Pop.Popup;
      end;
    end;
    先建立一个stringList 然后用 参数=值  作为字符串值add到list中,然后调用tidhttp.post函数 第一参数是要post的url,第二个参数是stringList  然后这个函数返回的就是页面的代码 其中包括html标签   其实就是网页
      

  2.   

    http://www.xx.com/login.asp?uid=a&pwd=bprocedure test;
    var
    strs:TStringList;
    begin
      strs := TStringList.Create;
      try 
        strs.add(uid=a);
        strs.add(pwd=b);
        showMessage(IdHttp.Post('http://www.xx.com/login.asp',strs));
      finally
       strs.Destroy;
      end;
    end;
      

  3.   

    以上都试过了,还是不行啊..参数都正确,但还是进不了页面,网页上是用form表单做的,有为空判断,请问为什么POST的参数正确可还是不行呢???急啊........
      

  4.   

    哦 :( 抱歉 应该用get你在url中加参数应该为get方法
      

  5.   

    还是不行呀!!!!都试过的.asp网页有为空判断,若FORM表单的值为空的话不能继续,但我想用参数传递不会被它影响吧..急....