Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
API Codes against Scripting.FileSystemObject
Message
 
 
À
28/07/2005 22:55:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01036845
Message ID:
01036846
Vues:
10
See How to change file attributes programmatically FAQ #15763

>
>With Scripting.FileSystemObject
>following codes works fine to set set file attribute "READONLY".
>
>But I want API codes equivalent to following codes to make a file READONLY.
>
>Please help
>
>* Define constants for file attributes
>#DEFINE FA_NORMAL 	0	&& Normal file. No attributes are set.
>#DEFINE FA_READONLY 	1	&& Read-only file.
>#DEFINE FA_HIDDEN 	2	&& Hidden file.
>#DEFINE FA_SYSTEM 	4	&& System file.
>#DEFINE FA_ARCHIVE 	32	&& File has changed since last backup.
>#DEFINE FA_VOLUME 	8 	&& Disk drive volume label. Attribute is read-only.
>#DEFINE FA_DIRECTORY 	16	&& Folder or directory. Attribute is read-only.
>#DEFINE FA_ALIAS 	1024	&& Link or shortcut. Attribute is read-only.
>#DEFINE FA_COMPRESSED 	2048	&& Compressed file. Attribute is read-only.
> LCFILE=curdir()+"PAY.EXE"
>oFSO = CREATEOBJECT("Scripting.FileSystemObject")
>oFile = oFSO.GetFile(lcFile) && lcFile is the name of the file
>oFile.Attributes = BITXOR(oFile.Attributes, FA_READONLY)
>oFile.Attributes = BITOR(oFile.Attributes, FA_READONLY)
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform