代码如下:
<html>
<head>
<meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<title>一个用于定时重启或关闭计算机的小工具、适用于windows 2k/xp/2003 </title>
<HTA:アプリケーション
id = "wtimer"
MaximizeButton = "no"
minimizebutton = "yes"
singleInstance = "はい"
ContextMenu = "はい"
sysmenu = "yes"
version = "1.0"
innerborder = "no"
キャプション= "はい"
showintaskbar = "yes"
border = "正常"
BORDERSTYLE = "正常"
ApplicationName = "Windowsタイマー"
icon = "timerico.ico"
/>
<style type = "text/css">
<! -
* {font-family:courier new、arial、sans-serif; font-size:9pt; }
ボディ{Overflow-y:隠された; }
Div A:link、div a:visited {text-decoration:none; color:#000}
Div A:Hover {Text-Decoration:underline; color:#f00}
#footerinfo {width:100%; display:table; margin-top:5px; }
#left {float:left; width:70%; }
#right {float:right; width:29%; text-align:right; margin-right:1px; }
- >
</style>
<スクリプト言語= "javascript">
<! -
$ bl_sleep = false;
function getobject($ obj){
return(document.getElementById($ obj));
}
string.prototype.parseint = function(){
return(parseint(this));
}
関数getRadioval($ name){
$ oems = document.getElementsbyname($ name);
for($ i = 0; $ i <$ oems.length; $ i ++){
if($ oems [$ i] .Checked){return($ oems [$ i] .value); }
}
}
関数isdeclared($ varname){
return(typeof($ varname)!= "undefined");
}
function chstatus($ name、$ status){
$ ooems = document.getElementsbyname($ name);
for($ a = 0; $ a <$ ooems.length; $ a ++){
$ ooems [$ a] .disabled = $ status;
}
}
関数window.onload(){
$ swidth = window.screen.width;
$ sheight = window.screen.height;
$ width = 400;
$ aheight = 185;
window.resizeto($ width、$ aheight);
window.moveto(($ swidth- $ width)/2、($ sheight- $ aheight)/2);
document.bgcolor = "#d4d0c8";
getobject( "stopbutton")。disabled = true;
getObject( "left")。innerhtml = "提示:请选择您想要使用的功能!";
}
function timer_quit(){
window.close();
}
function timer_kernel(){
if($ bl_sleep){
if(isdeclared($ time)&& isdeclared($ mod_time)&& isdeclared($ operation)){
if($ time> 0){
$ oper_str = "";
$ hint_str = "";
$ titl_str = "";
if($ operation == "rwin"){
$ oper_str = "<span style =/" color:red/">提示:系统计时重启功能已启用</span>";
}
それ以外 {
$ oper_str = "<span style =/" color:red/">提示:系统计时关闭功能已启用</span>";
}
if($ mod_time == "mod_minute"){
$ tminute =($ time/60).toString()。parseint();
$ tsecond = $ time%60;
if($ tminute!= 0){
if($ tsecond <10){
$ tsecond = "0"+$ tsecond;
}
$ titl_str = "剩余时间:"+$ tminute+"分"+$ tsecond+"秒";
}
それ以外 {
$ titl_str = "剩余时间:"+$ tsecond+"秒";
}
}
それ以外 {
$ titl_str = "剩余时间:"+$ time+"秒";