如何用nmhttp的get方法从www服务器获得文件??
procedure TMainForm.Button1Click(Sender: TObject);
begin
  nmhttp1.Get('http://10.131.131.10/index.html');
end;
以上用法为何不行啊???

解决方案 »

  1.   

    大多数是允许匿名访问的,有的不行,要求身份认证的,需要设置headinfo的userid和password的,你再仔细看看他的帮助
      

  2.   

    procedure TMainForm.NMHTTP1AuthenticationNeeded(Sender: TObject);
    var
      anid :string;
      apass:string;
    begin
       inputQuery('Authentication required', 'Enter a user ID', AnID);
      InputQuery('Authentication required', 'Enter a password', APass);   NMHTTP1.HeaderInfo.UserId := AnID;
       NMHTTP1.HeaderInfo.Password := APass;
    end;
    我加上了以上用户和密码验证事件,但还是不行????
      

  3.   

    NMHTTP1.InputFileMode := false;
            NMHTTP1.OutputFileMode := false;
            NMHTTP1.ReportLevel := 2;
            NMHTTP1.TimeOut := 400;
    NMHTTP1.Get('http://10...../index.html');