unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
function tamanioA(nom:String):integer;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//********************************************
function TForm1.tamanioA(nom:String):integer;
var
FHandle: integer;
begin
FHandle := FileOpen(nom, 0);
try
Result := (getfilesize(FHandle,nil));
finally
FileClose(FHandle);
end;
end;
//***********************************************
procedure TForm1.Button1Click(Sender: TObject);
var
aux: string;
i: integer;
begin
aux:='c:\sella5.pdf';
i:=((tamanioA(aux) div 1024) div 1024);
ShowMessage(aux + ' --> ' +inttostr(i) + ' Mb');
end;
end.
.
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario