quinta-feira, 7 de maio de 2015

Sabendo os atributos de arquivos.


Crie uma var do tipo word, por ex., Attributes. Depois, atribua a esta var o
valor retornado por FileGetAttr. Ex.:

var
Attributes: Word;
begin
Attributes := FileGetAttr( 'nomedoarquivo' );
// Supondo 4 CheckBoxe's, 1 para cada atributo, Ok?
CheckBox1.Checked := (Attributes and faReadOnly) = faReadOnly;
CheckBox2.Checked := (Attributes and faArchive) = faArchive;
CheckBox3.Checked := (Attributes and faSysFile) = faSysFile;
CheckBox4.Checked := (Attributes and faHidden) = faHidden;
end;

Nenhum comentário:

Postar um comentário