| 二、分頁打印 
 
 <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>
 
 |