Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining A File's Type
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00326276
Message ID:
00326740
Vues:
23
>>George,
>>
>>I ran the following:
>>
>>oFSO = CREATEOBJECT('Scripting.FileSystemObject')
>>oFile = oFSO.GetFile(cFile)
>>?oFile.Type
>>
>>on each file in a folder.
>>
>>Most VFP files are list as
>>'Microsoft Visual FoxPro Menu/Report/Labels....'
>>
>>However, PRG's are listed as 'Microsoft FoxPro for Windows'.
>>
>>What I really like to do is handle the user picking certain types
>>of files. Can I rely on these return values to be the same on all
>>PC's. Probably not, but I thought I'd ask.
>
>Kevin,
>
>What's being shown is the association stored in the registry. As Ken mentioned, this isn't 100% reliable. Unfortunately, it's the closest thing we've got.

Actually, it is reliable; it reports the setting last established for the system reliably and acurately. Last man standing wins. The trouble is, it may not be the answer you're looking for. Only examining the file extension can allow the system only to report what it has been told is the correct behavior for things with that extension - it makes its decision based on that context alone.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform