<%
'*** By Weerachai Nukitram ***'
'*** http://www.ThaiCreate.Com ***'
Option Explicit
Dim strName,strMessage,strFileName
strName = Request.Form("tName")
strMessage = Request.Form("tMessage")
strFileName = "thaicreate.txt"
Dim objFSO, objStream
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'*** Write Text file ***'
If strName <> "" and strMessage <> "" Then
Set objStream = objFSO.OpenTextFile(Server.MapPath("data/"&strFileName), 8, True)
objStream.WriteLine(strName & " say : " & strMessage)
objStream.Close
End IF
'*** Read Text file ***'
Set objStream = objFSO.OpenTextFile(Server.MapPath("data/"&strFileName))
Do Until objStream.AtEndOfStream
Response.Write objStream.ReadLine & "<br>"
Loop
objStream.Close
Set objStream = Nothing
Set objFSO = Nothing
Response.write("<div id='mydiv'></div>")
%>