首 页 ASP ASP.NET PHP JSP Ajax DIV+CSS JavaScript XML C#
MySQL MSSQL Access Oracle Linux Server 电脑技巧 网络安全 建站经验 其它

ASP.NET结合JS的网页打印程序

整理日期:2008年08月12日 【字体:


伊图教程网[www.etoow.com]
http://www.etoow.com/html/2008-08/1218566272.html

<script language="JavaScript">
var HKEY_Root,HKEY_Path,HKEY_Key;
HKEY_Root="HKEY_CURRENT_USER";
HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//设置网页打印的页眉页脚为空
function PageSetup_Null()
{
 try
 {
     var Wsh=new ActiveXObject("WScript.Shell");
 HKEY_Key="header";
 Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
 HKEY_Key="footer";
 Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
 }
 catch(e){}
}

//设置网页打印的页眉页脚为默认值
function PageSetup_Default()
{
 try
 {
 var Wsh=new ActiveXObject("WScript.Shell");
 HKEY_Key="header";
 Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&w&b页码,&p/&P");
 HKEY_Key="footer";
 Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&u&b&d");
 }
 catch(e){}
}
</script>
<input type="button" value="清空页码" onclick=PageSetup_Null()>
<input type="button" value="恢复页码" onclick=PageSetup_Default()> 
ASP.NET结合JS的网页打印程序
'http://www.etoow.com/html/2008-08/1218566272.html
1
 
信息搜索
  
联系我们关于本站广告服务设为首页 收藏本站友情链接网站地图
Copyright © Etoow.com Inc. All Rights Reserved