Ver Mensaje Individual
  #6  
Antiguo 16-07-2010
ingmichel ingmichel is offline
Miembro
 
Registrado: jun 2007
Posts: 137
Reputación: 17
ingmichel Va por buen camino
genial

gracias hermano, probe tu funcion y funciona perfecto, k dios te bendiga..


Cita:
Empezado por ecfisa Ver Mensaje
Hola ingmichel.

Una posibilidad es:
Código:
function NroArchivos(const Ruta: string): Integer;
var
  SRec: TSearchRec;
  Attr, re: Integer;
begin
  Result:= 0;
  Attr:= faSysFile + faAnyFile + faArchive + faHidden + faReadOnly;
  re:= FindFirst(Ruta + '*.*' , Attr, SRec);
  while re = 0 do
  begin
    Inc(Result);
    re:= FindNext(Srec);
  end;
end;
Llamada:
Código:
procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage(IntToStr(NroArchivos('C:\')));
end;
Nota: Al parámetro "Ruta" hay que terminarlo con '\', por: Ruta + '*.*'
Saludos.
Responder Con Cita