<html>
<head>
<title>页面设置</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<script language="javascript">
var HKEY_Root,HKEY_Path,HKEY_Key;
var HKEY_Root = "HKEY_CURRENT_USER";
var HKEY_Path = " Explorer\\PageSetup\\";
var HKEY_BASE = HKEY_Root + HKEY_Path;
var Wsh = new ActiveXObject("WScript.Shell");
function checkSubmit(){
}
//因为要调用组件来改写注册表,所改要把IE安全度调低一点
//Internet选项-安全-自定义级别
//特别ActiveX控件和插件那一栏,把禁用的改为提示
//初始化页面数据
function initData(){
try{
//document.getElementById"header").value = Wsh.RegRead(HKEY_BASE + "header"); //页眉
//document.getElementById"footer").value = Wsh.RegRead(HKEY_BASE + "footer"); //页脚
document.getElementById"margin_top").value = Wsh.RegRead(HKEY_BASE + "margin_top"); //上边距
document.getElementById"margin_bottom").value = Wsh.RegRead(HKEY_BASE + "margin_bottom"); //下边距
document.getElementById"margin_left").value = Wsh.RegRead(HKEY_BASE + "margin_left"); //左边距
document.getElementById"margin_right").value = Wsh.RegRead(HKEY_BASE + "margin_right"); //右边距
}catch(e){
alert('不能进行页面设置,请降低IE安全级别!\nInternet选项-安全-自定义级别\n[ActiveX控件和插件]一栏,把所有(禁用)的改为(提示)');
}
}
//保存数据
function saveData(){
try{
Wsh.RegWrite(HKEY_BASE + "header","");
Wsh.RegWrite(HKEY_BASE + "footer","");
Wsh.RegWrite(HKEY_BASE + "margin_top","<%=Request("margin_top")%>"); //上边距
Wsh.RegWrite(HKEY_BASE + "margin_bottom","<%=Request("margin_bottom")%>"); //下边距
Wsh.RegWrite(HKEY_BASE + "margin_left","<%=Request("margin_left")%>"); //左边距
Wsh.RegWrite(HKEY_BASE + "margin_right","<%=Request("margin_right")%>"); //右边距
initData();
alert('设置成功!');
self.close();
}
catch(e){
alert(e + "\n设置失败!");
}
}
//页面加载事件
function pageLoad(){
if(sy_QueryString("action") == "SAVE"){
saveData();
return;
}
initData();
}
</script>
</head>
<body onload="pageLoad()">
<form name="form1" method="post" action="PageSetup.asp?action=SAVE" onSubmit="return checkSubmit()" >
<table valign="center" align="center" width="95%" border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#4a65a5">
<tr>
<td bgcolor="#4a65a5"><font color="#FFFFFF">页边距:</font></td>
</tr>
<tr>
<td height="139">
<table width="100%" border="0" cellspacing="10" cellpadding="0" align="center" height="100%">
<tr>
<td height="99">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1" bgcolor="#336699"></td>
<td height="1" bgcolor="#336699"></td>
</tr>
<tr>
<td bgcolor="#f5f5f5" height="3"> </td>
<td bgcolor="#f5f5f5" height="3"> </td>
</tr>
<tr>
<td bgcolor="#f5f5f5" height="2">上:</td>
<td bgcolor="#f5f5f5">
<input type="text" id="margin_top" name="margin_top" size="20" value=""></td>
</tr>
<tr>
<td bgcolor="#f5f5f5" height="2">下:</td>
<td bgcolor="#f5f5f5">
<input type="text" id="margin_bottom" name="margin_bottom" size="20" value=""></td>
</tr>
<tr>
<td bgcolor="#f5f5f5" height="2">左:</td>
<td bgcolor="#f5f5f5">
<input type="text" id="margin_left" name="margin_left" size="20" value=""></td>
</tr>
<tr>
<td bgcolor="#f5f5f5" height="2">右:</td>
<td bgcolor="#f5f5f5">
<input type="text" id="margin_right" name="margin_right" size="20" value=""></td>
</tr>
<tr align="right">
<td height="80" bgcolor="#f5f5f5" colspan="2" align="center">
<input type="submit" name="subOk" value=" 提 交 " class="stbtm" style="margin-right:8px">
<input type="button" name="Submit3" value=" 取 消 " class="stbtm" onClick="javascript:self.close();">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr align="right">
<td bgcolor="#336699" height="3">
</td>
</tr>
</table>
</form>
</body>
</html>
中国足彩网信息请查看IT技术专栏