当前位置:编程学习 > asp >>

Asp实现批量生成静态页面实例代码

  1. <!-- #include file="../conn.asp" -->
  2. <!-- #include file="../cls_main.asp" -->
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Language" content="zh-cn">
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  7. <title>ASP批量生成静态页面</title>
  8. </head>
  9. <body>
  10. <%
  11. dim sid,eid
  12. sid=abs(request("sid"))
  13. if sid=0 then
  14. sid=0
  15. else
  16. sid=cint(request("sid"))
  17. end if
  18. eid=cint(request("eid"))
  19. if eid=0 then
  20. eid=500
  21. else
  22. eid=cint(request("eid"))
  23. end if
  24. Dim tt,ResNum
  25. Set tt = New Cls_Main
  26. ResNum = CLng(tt.Execute("select max(id) from table")(0))
  27. Set Mesky = Nothing
  28. %>
  29. <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
  30. <form method="POST" action="?action=html">
  31. <tr>
  32. <td width="9%">开始ID:</td>
  33. <td width="35%"><input type="text" name="sid" size="20" value="<%=sid%>"></td>
  34. <td width="8%">结束ID:</td>
  35. <td width="23%"><input type="text" name="eid" size="20" value="<%=eid%>">(最大ID:<%=ResNum%>)</td>
  36. <td width="23%"><input type="submit" value="提交" name="B1"></td>
  37. </tr>
  38. </form>
  39. <%
  40. if request("action")="html" then
  41. Response.Write " <tr><td colspan=5>" & vbNewLine
  42. Response.Write "<br><br>" & vbNewLine
  43. Response.Write "正在生成 <font color=red><b>" & eid & ".xml</b></font> 文件…… " & vbNewLine
  44. Response.Write "<br><br>" & vbNewLine
  45. Response.Write "  </td></tr><tr><td colspan=5>" & vbNewLine
  46. Response.Flush
  47. If (eid-500) > ResNum Then
  48. Response.Write "恭喜您操作成功!"
  49. Response.Flush
  50. else
  51. creat(sid)
  52. sid=sid 500
  53. eid=eid 500
  54. Response.Write "<meta http-equiv=""refresh"" content=""10;url=?action=html&sid="&sid&"&eid="&eid&""">"
  55. End If
  56. end if
  57. Function creat(id)
  58. Response.Write "<IFRame name=tt frameborder=0 width=100% height=30 scrolling=no src=http://www.xx.com/cls_create.asp?startid="&sid&"&endid="&eid&"></IFrame>"
  59. End Function
  60. %>
  61. </td></tr>
  62. </table>
  63. </body>
  64. </html>
补充:Web开发 , ASP.Net ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,