旅行社同业信息管理系统
RSS订阅 | 匿名投稿
您的位置:网站首页 > 广文博览 > 正文

ASP打印网页代码五个

作者:桐桐 来源: 日期:2012/2/28 0:08:50 标签:ASP打印网页

二、分页打印


  <html>
  <head>
  <style>  
  p {page-break-after: always}
  </style>
  </head>
  <body>
  <%while not rs.eof%>
  <p><%=rs(0)%></p>
  <%rs.movenext%>
  <%wend%>
  </body>
  </html>
三、asp页面打印时如何去掉页面底部的路径和顶端的页码编号
  (1)ie的文件-〉页面设置-〉讲里面的页眉和页脚里面的东西都去掉,打印就不出来了。
  (2)

<html>
  <head>
  <title> new document </title>
  <meta name="generator" content="editplus">
  <meta name="author" content="yc">
  <script language="vbscript">




dim hkey_root,hkey_path,hkey_key
  hkey_root="hkey_current_user"
  hkey_path="\software\microsoft\internet explorer\pagesetup"
  //设置网页打印的页眉页脚为空
  function pagesetup_null()
  on error resume next
  set regwsh = createobject("wscript.shell")
  hkey_key="\header"  
  regwsh.regwrite hkey_root+hkey_path+hkey_key,""
  hkey_key="\footer"
  regwsh.regwrite hkey_root+hkey_path+hkey_key,""
  end function
  //设置网页打印的页眉页脚为默认值
  function pagesetup_default()
  on error resume next
  set regwsh = createobject("wscript.shell")
  hkey_key="\header"  
  regwsh.regwrite hkey_root+hkey_path+hkey_key,"&w&b页码,&p/&p"
  hkey_key="\footer"
  regwsh.regwrite hkey_root+hkey_path+hkey_key,"&u&b&d"
  end function
  </script>
  </head>

  <body>
  <br/>
  <br/>
  <br/>
  <br/>
  <br/>
  <br/><p align=center>
  <input type="button" value="清空页码" onclick=pagesetup_null()> <input type="button" value="恢复页吗" onclick=pagesetup_default()><br/>

  </p>
  </body>
  </html>

分享到:
本文网址: