zoukankan      html  css  js  c++  java
  • ASP生成静态html

    录入的内容,自动生成html文件.
    演示地址

    <% 
    filename=year(now)&month(now)&day(now)&minute(now)&".htm"  '根据当前时间生成文件名
    if request("body")<>"" then 
    set objfso = Server.CreateObject("Scripting.FileSystemObject") '创建一个fso实例
    set htmout = objfso.CreateTextFile(server.mappath(""&filename&"")) 
    htmout.write "<html><head><title>"
    htmout.write request.form("title") 
    htmout.write "</title></head><body>新闻标题:"
    htmout.write request.form("title")
    htmout.write "<br>内容(body):" 
    htmout.write request.form("body") 
    htmout.write "</body></html>"
    htmout.close 
    set htmout=nothing 
    set objfso=nothing 
    end if 
    %> 
    <form name="form1" method="post" action="">
      <table width="300"  border="0" align="center">
        <tr>
          <td align="right">标题:</td>
          <td colspan="2"><input name="title" size=18></td>
        </tr>
        <tr>
          <td align="right">内容:</td>
          <td colspan="2"><textarea name="body"></textarea></td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td><input type="submit" name="Submit" value="生成"></td>
          <td><a href="<%=filename%>" target="_blank">查看输出的文件</a></td>
        </tr>
      </table>
      <br>
      <br>
      <br>
    </form>

  • 相关阅读:
    erlang遍历目录
    C/C++ makefile自动生成工具(comake2,autotools,linux),希望能为开源做点微薄的贡献!
    shell 文件操作
    互联网分享知识(一)
    分页查询,你真的懂吗?
    awk神器
    Unicode编码解码在线转换工具
    awk 留底
    软件开发真的这么简单吗?
    php性能优化
  • 原文地址:https://www.cnblogs.com/icejd/p/394087.html
Copyright © 2011-2022 走看看