DELPHI中的代码,用BUTTON1触发procedure TForm1.Button1Click(Sender: TObject);
var
  url:string ;
  temp_response:Tstringstream;
  temp:TStringList;
begin
  temp_response:=Tstringstream.Create('');
  try
    temp:=TStringList.Create;
      try
        url:='http://192.168.1.41/test.asp';
        temp.Add('title=hello,world');
      //IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
        idhttp1.Post(url,temp,temp_response);
        memo1.Lines.Text:=temp_response.DataString;
        temp.Free;
        temp_response.Free;
      except
        application.MessageBox('correct happened!','wrong',MB_iconerror+MB_OK);
        temp.Free;
        close;
      end;
   except
    application.MessageBox('correct happened!','wrong',MB_iconerror+MB_OK);
    temp_response.Free;
    close;
  end;
end;
我想在ASP面页就是test.asp中显示出 temp.Add('title=hello,world')中的内容我在ASP面页中的代码如下:<body>
hello world!!
<form name="form1" method="post" action="test.asp">    <input name="title" type="text" id="title">
 
    <input type="submit" name="Submit" value="提交">
<br>
  <% response.Write("content is:"&request.Form("title")) %></form>
</body>----------------
我也是照着别人的例子来做的,在test.asp中没有显示出title的'hello,world'内容。
而在Delphi中的memo1可以显示整个test.asp的代码,其中content is: hello,world  有显示出来。我也不知道这样是不是发送成功?请大家指导一下,我该怎么写这个test.asp这边的代码可以使我要发送的内容在网页上显示出来。先谢过了大家啊。祝元旦快乐!!

解决方案 »

  1.   

    <body>
    hello world!!
    <form name="form1" method="post" action="test.asp">
        <input name="title" type="text" id="title">
        <input type="submit" name="Submit" value="提交">
    <br>
        content is:<%= request("title") %>
    </form>应该就可以了!访问ASP的地址为
    yourasp.asp?title=Hello%20World混合语言我最拿手了 hoho!request("title") 相当于 request.Form("title")
      

  2.   

    行不通啊,我在DELPHI中进行发送,在网页上没有内容出现,哎!
      

  3.   

    应该是
      <body>
    hello world!!
    <form name="form1" method="post" action="test.asp">
        <input name="title" type="text" id="title">
        <input type="submit" name="Submit" value="提交">
    <br>
        content is:<%= request.querystring("title") %>
    </form>访问ASP文件的地址不变,
    因为像这种参数的传递应该被认为是GET方式的,
    如还是没有示,那应该是Delphi那段程序有问题吧!
      

  4.   

    建议都改成GET方式!
    还有,你得IIS启动了没有?
      

  5.   

    我试过了,没有办法,还是不成功,我的意思是说我在DELPHI中按下按钮,网页上就能出现信息,
    可是怎么试都不行啊,各位高手,能不能再帮帮我,给我一个完整的代码!在这里先跪谢了,这个是我公司实习要的东西,要不再赶不出来,就要被抄了啊。