代碼如下:
<html>
<頭>
<meta http-equiv =“ content-type” content =“ text/html; charset = gb2312”>
<Title>一個用於定時重啟或關閉計算機的小工具,適用於Windows 2K/XP/2003 </Title>
<hta:應用程序
id =“ wtimer”
最大化布頓=“否”
最小化=“是”
singleSinstance =“是”
contextMenu =“是”
sysmenu =“是”
版本=“ 1.0”
innerborder =“否”
字幕=“是”
ShowIntaskBar =“是”
邊界=“正常”
borderstyle =“正常”
ApplicationName =“ Windows Timer”
圖標=“ timerico.ico”
/>
<style type =“ text/css”>
<! -
* {font-formy:courier new,arial,sans-serif; font-size:9pt; }
身體{溢出Y:隱藏; }
Div A:鏈接,Div A:訪問{文本 - 刪除:無;顏色:#000}
Div A:Hover {文本 - 編寫:下劃線;顏色:#f00}
#FooterInfo {width:100%; display:table;保證金頂:5px; }
#left {float:左;寬度:70%; }
#right {float:right; width:29%; text-align:right; margin-right:1px; }
- >
</style>
<腳本語言=“ javascript”>
<! -
$ bl_sleep = false;
功能getObject($ obj){
返回(document.getElementById($ obj));
}
string.prototype.parseint = function(){
返回(Parseint(this));
}
函數getRadioval($ name){
$ oems = document.getElementsByname($ name);
對於($ i = 0; $ i <$ oems.length; $ i ++){
如果($ oems [$ i] .checked){return($ oems [$ i] .value); }
}
}
函數ISDECERARD($ varname){
返回(typeof($ varname)!=“ undefined”);
}
功能chstatus($ name,$ status){
$ ooems = document.getElementsByname($ name);
對於($ a = 0; $ a <$ ooems.length; $ a ++){
$ ooems [$ a] .disabled = $ status;
}
}
功能窗口.onload(){
$ swidth = window.screen.width;
$ sheight = window.screen.height;
$ awidth = 400;
$ aheight = 185;
window.resizeto($ awidth,$ aheight);
window.moveto(($ swidth- $ awidth)/2,($ sheight- $ aheight)/2);
document.bgcolor =“#d4d0c8”;
getObject(“ stopButton”)。禁用= true;
getObject(“左”)。 innerhtml =“提示:請選擇您想要使用的功能!”;
}
功能timer_quit(){
window.close();
}
功能timer_kernel(){
如果($ bl_sleep){
if(isDeclared($ time)&& isDeclared($ mod_time)&& isDeclared($ operation)){
如果($ time> 0){
$ oper_str =“”;
$ hint_str =“”;
$ titl_str =“”;
if($ operation ==“ rwin”){
$ oper_str =“ <span style =/”顏色:red/“>提示:系統計時重啟功能已啟用,請注意保存! </span>”;
}
別的 {
$ oper_str =“ <span style =/”顏色:red/“>提示:系統計時關閉功能已啟用,請注意保存! </span>”;
}
if($ mod_time ==“ mod_minute”){
$ tminute =($ time/60).toString()。 parseint();
$ tsecond = $ time%60;
如果($ tminute!= 0){
如果($ tsecond <10){
$ tsecond =“ 0”+$ tsecond;
}
$ titl_str =“剩餘時間:”+$ tminute+“分”+$ tsecond+“秒”;
}
別的 {
$ titl_str =“剩餘時間:”+$ tsecond+“秒”;
}
}
別的 {
$ titl_str =“剩餘時間:”+$ time+“秒”;