Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 11-07-2008
madmai madmai is offline
Miembro
 
Registrado: oct 2005
Posts: 117
Poder: 19
madmai Va por buen camino
File of byte y filesize

Código Delphi [-]
var
   f: file of Byte;
   size: Longint;
   S: string;
   y: Integer;
begin
  if OpenDialog1.Execute then
  begin
    AssignFile(f, OpenDialog1.FileName);
    Reset(f);
    try
      size := FileSize(f);
      S := 'File size in bytes: ' + IntToStr(size);
      y := 10;
      Canvas.TextOut(5, y, S);
      y := y + Canvas.TextHeight(S) + 5;
      S := 'Seeking halfway into file...';
      Canvas.TextOut(5, y, S);

      y := y + Canvas.TextHeight(S) + 5;
      Seek(f, size div 2);
      S := 'Position is now ' + IntToStr(FilePos(f));
      Canvas.TextOut(5, y, S);
    finally
      CloseFile(f);
    end;
  end;
end;

Con el siguiente codigo cuando elijo un fichero de mas de 2 gigas me sale un size en negativo que he de hacerlo para interpretarlo, y poner el tamaño real que tiene en megas, cuando es inferior a 2 gigas no tengo problema, gracias de antemano

Última edición por madmai fecha: 11-07-2008 a las 18:38:49.
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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Crear un Campo Byte sidneyb SQL 0 24-04-2008 21:43:04
Pasar string a byte Novás Varios 6 27-11-2007 20:18:38
Medio byte activo Al González La Taberna 4 06-09-2007 09:38:34
de BYTE a STRING emeceuy Varios 3 20-08-2004 16:29:32
ADO: Byte nulo (byte #0) en un string Pandre Conexión con bases de datos 0 02-04-2004 20:18:37


La franja horaria es GMT +2. Ahora son las 23:28:16.


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