Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File System Object
Message
De
22/03/1999 21:34:03
 
 
À
22/03/1999 20:50:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00200518
Message ID:
00200767
Vues:
9
>>I was doing a little coding in VB on the weekend, trying to simulate ADIR and other functions when I came across the File System Object.
>>
>>This object model of the file system, which also has methods to move and delete and rename files etc. is very elegant and works well in VFP.
>>
>>Here is a minor sample of what I mean. Change the path in GetFolder to one that exists on your own system.
>>
>>hide windows all
>>clear
>>
>>fso = CreateObject("Scripting.FileSystemObject")
>>fldr = fso.GetFolder("e:\vfp")
>>? "path is: " + fldr.path
>>? "Folder name is: " + fldr.name
>>
>>for each mfile in fldr.files
>> ? "File name is : " + PADR(mfile.name, 40) + " " + str(mfile.size)
>>endfor
>>
>>?
>>? "Folders found in this directory:"
>>For Each mfolder in fldr.subfolders
>> ? mfolder.name
>>endfor
>
>

>
>I fail to do this code:
>fso = CreateObject("Scripting.FileSystemObject")
>
>What should I install to make it works!?
>
>e.g. if install MS Office can make: CreateObject("Word.Basic")

You have to install the Windows Scripting Host to make the Scripting.FileSystemObject available.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform