guest.asp

来自「flash 源码」· ASP 代码 · 共 52 行

ASP
52
字号
<html><head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"></head>
<%
subject = request("sub")
name = request("name")
text = request("text")
action = request("action")

if (action <> "add") then

	set fin = Server.CreateObject("Scripting.FileSystemObject")
	filepath = Server.MapPath("guest.txt")
	set f = fin.OpenTextFile(filepath)
	buf = f.readAll
	response.write(buf)

	f.close
end if

if (action = "add") then

	set fin = Server.CreateObject("Scripting.FileSystemObject")
	filepath = Server.MapPath("guest.txt")
	set f = fin.OpenTextFile(filepath)
	line = f.readline
	total = int(mid(line,8))

	buf = f.readAll

	f.close

	set fout = Server.CreateObject("Scripting.FileSystemObject")

	Application.lock

	filepath = Server.MapPath("guest.txt")
	set f = fout.CreateTextFile(filepath,TRUE)

	total = total + 1
	f.writeline "&total="&total
	f.writeline "&sub"&total&"="&subject
	f.writeline "&name"&total&"="&name
	f.writeline "&text"&total&"="&text
	f.write buf

	f.close

	Application.unlock

	response.write("&added=1")
end if
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?