Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Send name of file to text file
Message
 
À
23/01/2002 04:17:18
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00608823
Message ID:
00609253
Vues:
12
>Is there a command to write the name of the VB file (for instance) to a text file?
>ie. give name of file that is currently running to a text file without manually having to have that name within the file.
>
>Confused? Please can someone help.... :|

Here is an example of using FileSystemObject to write text into a file:
Dim FSO as Object, objLogFile as Object

Set FSO = CreateObject("Scripting.FileSystemObject")
if not FSO.FileExists("C:\Backup.log") then
	FSO.CreateTextFile("C:\Backup.log")
end if
Set objLogFile = FSO.OpenTextFile("C:\Backup.log",8)
objLogFile.WriteLine ("Backup finished at " & Now() & ". ")
objLogFile.Close

Set FSO = Nothing
Set objLogFile = Nothing
Here is the link on FileSystemObject:
http://msdn.microsoft.com/library/default.asp?URL=/library/devprods/vs6/vbasic/vbcon98/vbconintroductiontofilesystemobjectmodel.htm

HTH,
Igor Gelin
Database Developer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform