delphi 的什么控件可以接受response 过来的数据  我想做一个程序 用于接受网站response过来的程序  谢谢ASP网站response的数据  delphi可以直接接收吗   请问各位大侠需要用到什么控件   我感觉直接接收好一点  不然好麻烦   

解决方案 »

  1.   

    uses ComObj;
    var
      url:string;
      xmlHttp:Olevariant;
      responseText:Widestring;
    begin
      url:='http://xxx.cn/xx.asp';
      try
        xmlHttp:=CreateOleObject('Msxml2.XMLHTTP');
        xmlHttp.open('POST',url,false);//如果只获得数据可以将POST修改成GET
        xmlHttp.send('a111111----111111');
        responseText:=xmlHttp.responseText;
        if xmlHttp.status='200' then
        begin
          //--ShowMessage(responseText);
        end
        else
        begin
          //--
        end;
      except
        On E:Exception do
          //--
      end;
    end;
      

  2.   

    您好 失踪的月亮 能不能实现不管ASP程序什么时候get数据到服务器 delphi程序随时都能接收到 就好像监听一样  
      

  3.   

         uses ComObj;var
      url:string;
      xmlHttp:Olevariant;
      responseText:Widestring;
    begin
      url:='http://xxx.cn/xx.asp';
      try
        xmlHttp:=CreateOleObject('Msxml2.XMLHTTP');
        xmlHttp.open('POST',url,false);//如果只获得数据可以将POST修改成GET
        xmlHttp.send('a111111----111111');
        responseText:=xmlHttp.responseText;
        if xmlHttp.status='200' then
        begin
          //--ShowMessage(responseText);
        end
        else
        begin
          //--
        end;
      except
        On E:Exception do
          //--
      end;
    end;ASP站 get数据到delphi软件所在的服务器上您写的这段程序 怎么样才能接受到呢? 我只想接收谢谢  最好能用idhttp.get  接收下 能给下示范吗  
      

  4.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, Buttons, Comobj;type
      TForm1 = class(TForm)
        BitBtn1: TBitBtn;
        procedure BitBtn1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.BitBtn1Click(Sender: TObject);
    var
      url:string;
      xmlHttp:Olevariant;
      responseText:Widestring;
    begin
      url:='http://xxx.cn/xx.asp';//你要调用的url
      try
        xmlHttp:=CreateOleObject('Msxml2.XMLHTTP');
        xmlHttp.open('GET',url,false);
        xmlHttp.send();
        responseText:=xmlHttp.responseText;
        if xmlHttp.status='200' then
        begin
          ShowMessage(responseText);//这里显示的就是接收到的数据
        end
        else
        begin
          ShowMessage('有错误');
          //--
        end;
      except
        On E:Exception do
          //--
          ShowMessage('调用过程出现异常');
      end;
    end;end.
      

  5.   

    您可能没明白我的意思  不是叫delphi程序主动去获取网页中的内容   而是asp程序主动GET数据到DELPHI程序所在的服务器 DELPHI程序接收就可以了   这个是不是需要设置控件的IP与端口等!