您现在的位置是:网站首页> 编程资料编程资料
ASP生成静态htm页面基本代码_应用技巧_
2023-05-25
358人已围观
简介 ASP生成静态htm页面基本代码_应用技巧_
以下虚线框内为mk.asp文件的具体代码:
--------------------------------------------------------------------------------
<%
filename="test.htm"
if request("body")<>"" then
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fout = fso.CreateTextFile(server.mappath(""&filename&""))
fout.write "标题(title):" & request.form("title") & "
"
fout.write "内容(body):" & request.form("body")
fout.close
set fout=nothing
set fso=nothing
end if
%>
--------------------------------------------------------------------------------
然后在浏览器输入mk.asp这个页面,填写完毕后,就会生成test.htm这个文件,里面的内容就是你刚才填写的。
--------------------------------------------------------------------------------
<%
filename="test.htm"
if request("body")<>"" then
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fout = fso.CreateTextFile(server.mappath(""&filename&""))
fout.write "标题(title):" & request.form("title") & "
"
fout.write "内容(body):" & request.form("body")
fout.close
set fout=nothing
set fso=nothing
end if
%>
--------------------------------------------------------------------------------
然后在浏览器输入mk.asp这个页面,填写完毕后,就会生成test.htm这个文件,里面的内容就是你刚才填写的。
您可能感兴趣的文章:
