Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
API Codes against Scripting.FileSystemObject
Message
De
28/07/2005 22:55:22
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
API Codes against Scripting.FileSystemObject
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01036845
Message ID:
01036845
Vues:
61
Dear Experts

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)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform