Voltar   OpenNFSe > Programação > Delphi Help > Exemplos
Stats Comunidade Calendário Postados Hoje Pesquisar

Resposta
 
LinkBack Ferramentas do Tópico Modos de Exibição

 
  #1 (permalink)  
Antigo 24/10/2009
Avatar de LuizVaz
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
Resposta

Tags
windows desenv delphi


Regras para Posts
Você não pode postar novos tópicos
Você não pode postar respostas
Você não pode postar anexos
Você não pode editar seus posts

Código [IMG] Sim
Código HTML Não
Trackbacks are Sim
Pingbacks are Sim
Refbacks are Sim



Horários baseados na GMT -2. Agora são 01:12.



vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0