1个回答
展开全部
index.asp 文件
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>单文件留言板</title>
<style>
body{font-size:9pt}
</style>
</head>
<body>
<div style="border-style:dotted; border-width:1px; POSITION:absolute; TOP:17px; width:653px; left:22px">
留言列表:<hr color=#CDF583>
<ol>
<%
set fs=server.createobject("scripting.filesystemobject")
file=server.mappath("data.txt")
set txt=fs.opentextfile(file,1,true)
if not txt.atendofstream then
line=txt.ReadAll
response.write line&"<br>"
end if %>
</li>
</ol>
<p> <%=data2("data.txt")%>
<hr color=#CDF583><form method=POST action="">
<input type=text name=mz size=20 value=by><--你的大字
<textarea name=data cols=72 rows=9></textarea><br><input type=submit value="<li>留言:" name=txt> ©蚊虫</form>
<%
Function data2(MyFile)
Dim objFSO,objTS
Application.Lock
Set objFSO=Server.CreateObject("Scripting.FileSystemObject")
Set objTS=objFSO.OpenTextFile(Server.MapPath(MyFile),8,True)
txt2=Request("txt")
data2=Request("data")
mz2=Request("mz")
sj2=Now()
objTS.WriteLine(txt2)
objTS.WriteLine(data2)
objTS.WriteLine( mz2)
objTS.WriteLine(sj2)
objTS.Close
Application.Unlock
End Function
%></div></body></html>
在目录下新建Data.txt就可以正常使用了.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>单文件留言板</title>
<style>
body{font-size:9pt}
</style>
</head>
<body>
<div style="border-style:dotted; border-width:1px; POSITION:absolute; TOP:17px; width:653px; left:22px">
留言列表:<hr color=#CDF583>
<ol>
<%
set fs=server.createobject("scripting.filesystemobject")
file=server.mappath("data.txt")
set txt=fs.opentextfile(file,1,true)
if not txt.atendofstream then
line=txt.ReadAll
response.write line&"<br>"
end if %>
</li>
</ol>
<p> <%=data2("data.txt")%>
<hr color=#CDF583><form method=POST action="">
<input type=text name=mz size=20 value=by><--你的大字
<textarea name=data cols=72 rows=9></textarea><br><input type=submit value="<li>留言:" name=txt> ©蚊虫</form>
<%
Function data2(MyFile)
Dim objFSO,objTS
Application.Lock
Set objFSO=Server.CreateObject("Scripting.FileSystemObject")
Set objTS=objFSO.OpenTextFile(Server.MapPath(MyFile),8,True)
txt2=Request("txt")
data2=Request("data")
mz2=Request("mz")
sj2=Now()
objTS.WriteLine(txt2)
objTS.WriteLine(data2)
objTS.WriteLine( mz2)
objTS.WriteLine(sj2)
objTS.Close
Application.Unlock
End Function
%></div></body></html>
在目录下新建Data.txt就可以正常使用了.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询