[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
ASPFAQ_WriteTextFile
Back to ASP FAQ Main Page.
How to write to a textfile
This example will show you how to write to a textfile in ASP.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
ASPFAQ_WriteTextFile
Back to ASP FAQ Main Page.
How to write to a textfile
This example will show you how to write to a textfile in ASP.
<%
'How to write to a textfile example
'
'(c) 2001 Programmers Heaven
'http://www.programmersheaven.com
const ForAppending=8
const TristateFalse=0
dim f,fsobj,filename
'Create a filesystem object
Set fsobj = CreateObject("Scripting.FileSystemObject")
'The path and filename to write to
filename="c:\testfile.txt"
'Open the textfile, create a new if it does not already exist
Set f = fsobj.OpenTextFile(filename, ForAppending,true,TristateFalse)
'Write to textfile
f.Writeline "This is a test!"
'Close the file
f.Close
'Free the objects
set f=nothing
set fsobj=nothing
%>
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
