Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi SetFileAttribute (https://www.delphipraxis.net/48490-setfileattribute.html)

Clane 26. Jun 2005 10:29


SetFileAttribute
 
hallo

kann mir einer die funktion an dem bespiel der boot.ini erklären wenn ich die sichtbar machen will und nich read only ?? ich komm damit nich klar und boardscuhe und google geben auch nich wirklich viel her

Mfg. PBiggi

MathiasSimmack 26. Jun 2005 11:03

Re: SetFileAttribute
 
Hier ist ein kleines Beispiel "versteckt". Ein erzeugter Ordner wird auf read only gesetzt, eine Datei auf hidden und system.

Sprint 26. Jun 2005 11:38

Re: SetFileAttribute
 
Delphi-Quellcode:
var
  Attr: DWORD;
begin

  if FileExists(FileName) then
  begin
    Attr := GetFileAttributes(PChar(FileName));
    Attr := Attr and not FILE_ATTRIBUTE_HIDDEN;
    SetFileAttributes(PChar(FileName), Attr);
  end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:18 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz