writing to a text file

S

spiderman

Hi,
Could someone show me how to write (String data) to a text file from an ASP
page? Thank you
 
S

Steven Burn

<%
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

Set objFSO = Server.createobject("scripting.filesystemobject")
strFile = Server.MapPath("the_file.txt")

Set objStream = objFSO.OpenTextFile(strFile, ForAppending, True)

objStream.WriteLine "Some text"
objStream.Close

Set objStream = Nothing
Set objFSO = Nothing
%>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
S

spiderman

Thank you

Steven Burn said:
<%
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

Set objFSO = Server.createobject("scripting.filesystemobject")
strFile = Server.MapPath("the_file.txt")

Set objStream = objFSO.OpenTextFile(strFile, ForAppending, True)

objStream.WriteLine "Some text"
objStream.Close

Set objStream = Nothing
Set objFSO = Nothing
%>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
S

spiderman

Thank you very much

Steven Burn said:
<%
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

Set objFSO = Server.createobject("scripting.filesystemobject")
strFile = Server.MapPath("the_file.txt")

Set objStream = objFSO.OpenTextFile(strFile, ForAppending, True)

objStream.WriteLine "Some text"
objStream.Close

Set objStream = Nothing
Set objFSO = Nothing
%>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top