下面提供给大家
一起学习分享的是教你用ASP代码写文件记录不用数据库的实例代码,希望能给大家带来帮助或启发。
<%
if request("action")="save" then
web_name=trim(request.form("web_name"))
web_url=trim(request.form("web_url"))
web_email=trim(request.form("web_email"))
web_keyword=trim(request.form("web_keyword"))
web_qq=trim(request.form("web_qq"))
set fso=Server.CreateObject("Scripting.FileSystemObject")
set zy=fso.CreateTextFile(Server.MapPath("config.asp"),True) '-----写在 config.
asp文件里面 !
zy.writeline "<"&chr(37)
zy.writeline "web_name="&chr(34)&""&web_name&""&chr(34)&""
zy.writeline "web_url="&chr(34)&""&web_url&""&chr(34)&""
zy.writeline "web_email="&chr(34)&""&web_email&""&chr(34)&""
zy.writeline "web_keyword="&chr(34)&""&web_keyword&""&chr(34)&""
zy.writeline "web_qq="&chr(34)&""&web_qq&""&chr(34)&""
zy.writeline chr(37)&">"
set zy=nothing
set fso=nothing
response.write"<script language='java script'>alert('设置成功!');location.href('?');</script>"
end if
%>