你好,欢迎来到电脑编程技巧与维护杂志社! 杂志社简介广告服务读者反馈编程社区  
合订本订阅
 
 
您的位置:技术专栏 / Linux开发
ASP动态网页开发中的WEB打印代码大全(3)
 
 3、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>

(编辑:aniston)

  推荐精品文章

·2024年12月目录 
·2024年11月目录 
·2024年10月目录 
·2024年9月目录 
·2024年8月目录 
·2024年7月目录 
·2024年6月目录 
·2024年5月目录 
·2024年4月目录 
·2024年3月目录 
·2024年2月目录 
·2024年1月目录
·2023年12月目录
·2023年11月目录

  联系方式
TEL:010-82561037
Fax: 010-82561614
QQ: 100164630
Mail:gaojian@comprg.com.cn

  友情链接
 
Copyright 2001-2010, www.comprg.com.cn, All Rights Reserved
京ICP备14022230号-1,电话/传真:010-82561037 82561614 ,Mail:gaojian@comprg.com.cn
地址:北京市海淀区远大路20号宝蓝大厦E座704,邮编:100089