begin
with adoquery1 do
begin
 close;
 sql.clear;
 sql.add('select top 1 id,mobile,serviceCode,linkid,spNum,moMsg from tb_118 where type=0 order by id');
 open;
 a:= adoquery1.recordcount;
 id:=adoquery1.fieldbyname('id').asinteger;
 mobile:= adoquery1.fieldbyname('mobile').asstring;
 servicecode:= adoquery1.fieldbyname('serviceCode').asstring;
 linkid:= adoquery1.fieldbyname('linkid').asstring;
 spnum:= adoquery1.fieldbyname('spNum').asstring;
 momsg:= adoquery1.fieldbyname('moMsg').asstring; Memo2.Lines.Text:= idhttp1.get('http://localhost/cxxt_sms/get/get1.asp?mobile=:mobile&servicecode=:servicecode&linkid=:linkid&spnum=:spnum&momsg=:momsg');
最后那一个代码,是传递HTTP参数,格式是这样写吗,我这不能成功,望高手指教

解决方案 »

  1.   

    高手,不行啊
    Memo2.Lines.Text:= idhttp1.get('http://localhost/cxxt_sms/get/get1.asp?mobile=:mobile&servicecode=:servicecode&linkid=:linkid&spnum=:spnum&momsg=:momsg');我在这用这个代码把参数传递上去之后,接收到的直接还是:mobile 而不是这个参数所代表的内容,
      

  2.   


    var Ts:TStringStream;
    Ts:=TStringStream.Create('');
    idhttp1.get('http://localhost/cxxt_sms/get/get1.asp?mobile='+mobile+'&servicecode='+servicecode+'&linkid='+linkid+'&spnum='+spnum+'&momsg='+momsg,Ts);
    Memo2.Lines.Text:=Ts.DataString;
      

  3.   

    把参数里的冒号都去掉
    另外=号后面的值不是mobile这样的吧,应该是138XXXXX这样的吧
      

  4.   


    我不知道您这种是否正确,但是我用这种方法一运行,会提示http 1.1 400 bad request错误
      

  5.   

    var
      toUrl: string;
    begin
      toUrl := 'http://localhost/cxxt_sms/get/get1.asp?mobile='+mobile+'&servicecode='+servicecode+'&linkid='+linkid+'&spnum='+spnum;
      idhttp1.get(toUrl )¡­ 
    end;在idhttp1.get设个断点,然后把toUrl的值取出来放到IE里试试