Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change File Attribute
Message
De
08/06/2005 08:32:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/06/2005 01:57:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01021228
Message ID:
01021306
Vues:
20
>Dear Experts
>
>There is a file in following location
>
>C:\WINDOWS\SYSTEM\UTILITY.DLL
>
>The property of this file is HIDDEN
>
>I want to change this property to un hidden
>
>How is it possible programatically?
>
>Please help
* Sample usage. Omitting RO,Hidden,System parameters - all would be .F.
ChangeFileAttrib("C:\WINDOWS\SYSTEM\UTILITY.DLL") 


Funtion ChangeFileAttrib
lparameters tcFileName, tlReadOnly, tlHidden, tlSystem

#define FILE_ATTRIBUTE_READONLY    0x00000001  
#define FILE_ATTRIBUTE_HIDDEN      0x00000002  
#define FILE_ATTRIBUTE_SYSTEM      0x00000004  

local lnNewAttr
lnNewAttr = iif(m.tlReadonly,FILE_ATTRIBUTE_READONLY,0)+;
	  iif(m.tlHidden,FILE_ATTRIBUTE_HIDDEN,0)+;
	  iif(m.tlSystem,FILE_ATTRIBUTE_SYSTEM,0)
declare integer SetFileAttributes in Win32API ;
	string @ lpFileName,  integer dwFileAttributes
declare integer GetFileAttributes in Win32API ;
  string @ lpFileName
  
SetFileAttributes(@tcFilename, ;
     bitor(bitand(GetFileAttributes(@tcFilename),0xFFFFFFF8),m.lnNewAttr))
endfunc
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform