Discuz教程网

ASP批量生成静态页面的写法(批量生成技巧iframe)

[复制链接]
authicon dly 发表于 2011-9-10 21:48:21 | 显示全部楼层 |阅读模式
  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>生成百度XML</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>
复制代码



上一篇:ASP常见错误详解及解决方案小结
下一篇:rs.open sql,conn,1,1与rs.open sql,conn,1.3还有rs.open sql,conn,3,2区别
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 10:38

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表