加入收藏 | 设为首页 | 会员中心 | 我要投稿 汽车网 (https://www.0577qiche.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

ASP创建静态htm页面基本代码

发布时间:2023-09-06 12:32:31 所属栏目:Asp教程 来源:
导读:以下虚线框内为mk.asp文件的具体代码:
--------------------------------------------------------------------------------
<%
filename="test.htm"
if request("body")<>"" then
set fso = Server.CreateObj
以下虚线框内为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") & "<br>"
fout.write "内容(body):" & request.form("body")
fout.close
set fout=nothing
set fso=nothing
end if
%>
<form name="form1" method="post" action="">
<input name="title" size=18><br>
  <textarea name="body"></textarea>
  <br>
  <br>
  <input type="submit" name="Submit" value="生成">
</form>

--------------------------------------------------------------------------------
然后在浏览器输入mk.asp这个页面,填写完毕后,就会生成test.htm这个文件,里面的内容就是你刚才填写的。

(编辑:汽车网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章