调用IE的打印(window.print),又不想弹出打印的对话框,如何解决?
急~~~~~~~~~
------解决方案--------------------要是用window.print 的话肯定是不行的
------解决方案--------------------window.print不行,不然成漏洞了,一个命令用户的打印机就开始工作了
------解决方案--------------------以前写的
<%@ Page language= "c# " Codebehind= "printPass.aspx.cs " AutoEventWireup= "false " Inherits= "drPeng.HS.HotelManage.Account.printPass " %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN " >
<HTML>
<HEAD>
<title> 客户网络开通 </title>
<link href= "../css/manage.css " type= "text/css " rel= "stylesheet ">
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<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 RegWsh = new ActiveXObject( "WScript.Shell ") ;
hkey_key= "header " ;
RegWsh.RegWrite(hkey_root+hkey_path+hkey_key, " ") ;
hkey_key= "footer " ;
RegWsh.RegWrite(hkey_root+hkey_path+hkey_key, " ") ;
}
catch(e){}
}
// 设置页眉页脚为默认值
function PageSetup_Default()
{
try{
var RegWsh = new ActiveXObject( "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 ") ;
}
catch(e){}
}
// 打印
function PrintPage()
{
PageSetup_Null();
document.getElementById( 'btnSub ').style.display = "none ";
document.getElementById( 'btnBack ').style.display = "none ";
document.getElementById( 'subLine ').style.display = "none ";
wb.execwb(6,1);
PageSetup_Default();
}
</Script>
<style type= "text/css "> .STYLE1 { FONT-SIZE: 12pt; COLOR: #0066ff } </style>
</HEAD>
<body>
<object classid= "CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 " height=0 id=WB name=wb width=0 VIEWASTEXT> </object>
<form id= "Form1 " method= "post " runat= "server ">
<table width= "380 " bgcolor= "gainsboro " cellSpacing= "0 " cellPadding= "0 " align= "center " border= "0 ">
<tr>
<td>
<table width= "100% " cellSpacing= "1 " cellPadding= "2 " border= "0 " align= "center ">
<tr bgcolor= "white ">
<td height= "25 " colspan= "2 " align= "center " valign= "middle "> <span class= "STYLE1 "> 房间[ <%=room%> ]网络访问帐号 </span> </td>
</tr>
<tr bgcolor= "white ">