在页面里用代码怎么实现。不想在IE里设置
期待高手指导。
谢谢
期待高手指导。
谢谢
解决方案 »
- 紧急求助:Vs2008创建的一个网站(.sln),如何在VS 2005正确打开?
- 如何调用AssemblyInfo.cs里的AssemblyFileVersion信息
- 如何取出src地址
- 能不能在wince系统浏览器中运行dataview控件或者日期控件?
- 一个Javascript问题
- 高手help me!
- 第一次做网站,用dreamweaver设计好的网页,我想用asp.net写后台,请问应该怎样做?
- 关于混合windows验证和forms验证的问题
- 从数据表里传值的问题?
- 怎么在Application_Error判断是否出现500错误
- 关于listbox里的数据无法提交到服务器
- 利用WebService发送传真问题?送分100.不够可再加分.
var url = "url.aspx?param=" + escape(param);
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,""
hkey_key="\margin_bottom"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75" //控制"纵打"、 横打”和“页面的边距。
hkey_key="\margin_left"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75"
hkey_key="\margin_right"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75"
hkey_key="\margin_top"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75"
end function
</SCRIPT><BODY leftMargin="0" topMargin="0" onload="pagesetup_null()" rightMargin="0" ms_positioning="GridLayout">这个是可以的
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<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,""
hkey_key="\margin_bottom"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75" //控制"纵打"、 横打”和“页面的边距。
hkey_key="\margin_left"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75"
hkey_key="\margin_right"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75"
hkey_key="\margin_top"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75"
end function
</SCRIPT>
</head><body onload="pagesetup_null()">
<p>测试打印</p>
<p>测试打印 </p>
<p>测试打印测试打印测试打印</p>
<p> </p>
<p>
<input type="button" name="Submit" value="打印" onclick="JavaScript:window.print();" />
<input type="button" name="Submit2" value="打印设置" onclick="JavaScript:window.focus();WebBrowser1.ExecWB(8,1);" />
<OBJECT id="WebBrowser1" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" VIEWASTEXT>
</OBJECT>
</p>
</body>
</html>