WEB打印去除页眉页脚
网上已流传很多例子:
<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,""
'window.print
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>
但经在我系统环境下测试,却不好使,不知道为什么“Win2003+IIS6.0”
直接用IE打开:C:\test.html 调式清除和恢复,除了有提示,是可以成功的
如是通用IIS打开:http://localhost/test.html 调式不但没有提法,也没有办法清除与恢复,即使把test.html改成asp,asp.net也是一样的。
请不要说直接通过 IE==>文件==>页面设置,之类的手动清除的话来,如果需要这样,就不会求代码了。。。
请高人讲解,为什么通过IIS打开就不行了呢?顺便给源码,小弟感激不尽。。。。