Example to write to text file :
<%
session("txt")="Write this text in the file"
Set fs = CreateObject("Scripting.FileSystemObject")
Set wfile = fs.CreateTextFile(Server.MapPath("/test.txt"), True)
wfile.Write (session("txt"))
wfile.close
Set wfile=nothing
Set fs=nothing
response.write("Text created")
%>
Example to read from text file :
<%
Set fs = CreateObject("Scripting.FileSystemObject")
Set wfile = fs.OpenTextFile(Server.MapPath("/test.txt"))
session("Test") = wfile.ReadAll
wfile.close
Set wfile=nothing
Set fs=nothing
response.write(session("Test"))
%>