Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > API de Windows
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #4  
Antiguo 25-11-2005
Avatar de jhonny
jhonny jhonny is offline
Jhonny Suárez
 
Registrado: may 2003
Ubicación: Colombia
Posts: 7.070
Poder: 32
jhonny Va camino a la famajhonny Va camino a la fama
Segun el truco 351 de trucomania es asi:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
 
  function GetDirectorySize(const ADirectory: string): Integer;
  var 
    Dir:  TSearchRec;
    Ret:  integer;
    Path: string;
  begin 
    Result := 0;
    Path   := ExtractFilePath(ADirectory);
    Ret    := Sysutils.FindFirst(ADirectory, faAnyFile, Dir);
 
    if Ret <> NO_ERROR then 
      exit;
 
    try
      while ret=NO_ERROR do 
      begin 
        inc(Result, Dir.Size);
        if (Dir.Attr in [faDirectory]) and (Dir.Name[1] <> '.') then 
           Inc(Result, GetDirectorySize(Path + Dir.Name + '\*.*'));
        Ret := Sysutils.FindNext(Dir);
      end; 
    finally
      Sysutils.FindClose(Dir);
    end; 
  end; 
 
 
begin 
  Caption:=IntToStr( GetDirectorySize('c:\delphi3') );
end;

Si lo asignas a Caption como esta en la funcion aprecera en la barra de titulo del formulario.

Nota: Por favor no vuelvas a repetir hilos.
espero te sirva .
__________________
Lecciones de mi Madre. Tema: modificación del comportamiento, "Pará de actuar como tu padre!"

http://www.purodelphi.com/
http://www.nosolodelphi.com/
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 08:01:28.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi