Ver um Único Post

 
  #1 (permalink)  
Antigo 24/10/2009
Avatar de LuizVaz
LuizVaz LuizVaz está offline
Administrator
Super Admin
Points: 10,505, Level: 68 Points: 10,505, Level: 68 Points: 10,505, Level: 68
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
 
Registrado em: Oct 2009
Localização: Belo Horizonte
Posts: 86
Thanks: 2
Thanked 6 Times in 6 Posts
Activity Longevity
0/20 20/20
Today Posts
sssssss86
Enviar mensagem via Windows Live Messenger para LuizVaz Enviar mensagem via Yahoo para LuizVaz
Padrão Função para formatar Bytes como no explorer

Função de para formatar o tamanho em bytes igual ao Explorer.
Basta adicionar a unit shlwapi para a sua unit antes.


Código:
Uses shlwapi;


//Retorna o tamanho com sufixo: bytes, KB, MB, GB
function ByteSize(Value: Int64): String;
var buf: array[0..20] of Char;
begin
  if StrFormatByteSizeW(Value, @buf, Length(buf)) = nil then
    raise EConvertError.CreateFmt('Error converting %d', [Value]);
  Result := WideCharToString(@buf);
end;
Luiz Vaz
Responder com Citação
 

Content Relevant URLs by vBSEO 3.3.0