function Tform1.DownConfigreFile(var errmsg: string; url, name: string): boolean; var MyStream: TMemoryStream; begin Result := true; MyStream := TMemoryStream.Create; try try httpUpdate.Get(url + name, MyStream); MyStream.SaveToFile(ExtractFilePath(Application.exename) + name); except on e: Exception do begin errmsg := e.Message; // 返回错误信息 Result := false; end; end; finally MyStream.Free; end; end;