国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > HTML > 正文

hta實(shí)現(xiàn)的定時(shí)重啟或關(guān)閉計(jì)算機(jī)的小工具

2020-01-25 19:40:26
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
一個(gè)用于定時(shí)重啟或關(guān)閉計(jì)算機(jī)的小工具,適用于Windows 2K/XP/2003
 
<!-- 
/*------------------------------------------------------------------------------- 
Description:一個(gè)用于定時(shí)重啟或關(guān)閉計(jì)算機(jī)的小工具,適用于Windows 2K/XP/2003 
Author:十一狼 
Email:112183883@163.com 
QQ:112183883 
WebSite:http://www.w3cg.net/ 
-------------------------------------------------------------------------------*/ 
--> 
<html> 
<head> 
<title>♀Windows系統(tǒng)計(jì)時(shí)器♀</title> 
<meta http-equiv="content-type" content="text/html;charset=gb2312"> 


<hta:application 
         id="WTimer" 
         maximizebutton="No" 
         minimizebutton="Yes" 
         singleinstance="Yes" 
         contextmenu="Yes" 
         sysmenu="Yes" 
         version="1.0" 
         innerborder="No" 
         caption="Yes" 
         showintaskbar="Yes" 
         border="Normal" 
         borderstyle="Normal" 
         applicationname="Windows Timer" 
         icon="TimerIco.ico" 
/> 


<Style type="text/css"> 
<!-- 
* { font-family:Courier New,Arial,Sans-serif;font-size:9pt; } 
body { overflow-y:hidden; } 
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> 


<Script Language="JavaScript"> 
<!-- 


$bl_Sleep=false; 


function getObject($obj) { 
         return(document.getElementById($obj)); 



String.prototype.parseInt=function() { 
         return(parseInt(this)); 



function getRadioVal($name) { 
         $oEms=document.getElementsByName($name); 
         for ($i=0;$i<$oEms.length;$i++) { 
                     if ($oEms[$i].checked) { return($oEms[$i].value); } 
         } 



function 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; 
         } 



function window.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").disabled=true; 
         getObject("left").innerHTML="提示:請(qǐng)選擇您想要使用的功能!"; 



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/">提示:系統(tǒng)計(jì)時(shí)重啟功能已啟用,請(qǐng)注意保存!</span>";  
                                     } 
                                     else {  
                                                 $Oper_str="<span style=/"color:red/">提示:系統(tǒng)計(jì)時(shí)關(guān)閉功能已啟用,請(qǐng)注意保存!</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="剩余時(shí)間:"+$tMinute+"分"+$tSecond+"秒"; 
                                                 } 
                                                 else { 
                                                         $Titl_str="剩余時(shí)間:"+$tSecond+"秒"; 
                                                 }  
                                     } 
                                     else { 
                                                 $Titl_str="剩余時(shí)間:"+$time+"秒"; 
                                     } 
                                     getObject("left").innerHTML=$Oper_str; 
                                     document.title=$Titl_str; 
                                     $time=$time-1; 
                                     $o=setTimeout("Timer_Kernel()",1000); 
                             } 
                             else { 
                                     $Flag=""; 
                                     if ($operation=="rWin") { 
                                                 $Flag=6;         //6為重啟操作系統(tǒng) 
                                     } 
                                     else { 
                                                 $Flag=1;         //1為關(guān)閉操作系統(tǒng) 
                                     } 
                                     OperateWin32($Flag); 
                                     getObject("left").innerHTML="<span style=/"color:red/">提示:正在執(zhí)行預(yù)定操作!</span>"; 
                                     document.title="正在執(zhí)行預(yù)定操作"; 
                             } 
                     } 
         } 



function Timer_Stop() { 
         $bl_Sleep=false; 
         if (isDeclared($o)) { clearTimeout($o); } 
         getObject("time").disabled=false; 
         getObject("mod_time").disabled=false; 
         chStatus("operation",false); 
         getObject("StartButton").disabled=false; 
         getObject("StopButton").disabled=true; 
         getObject("left").innerHTML="提示:請(qǐng)選擇您想要使用的功能!"; 
         document.title="♀Windows系統(tǒng)計(jì)時(shí)器♀"; 



function Timer_Start() { 
         $bl_Sleep=true; 
         $nowTime=""; 
         $time=getObject("time").value; 
         $mod_time=getObject("mod_time").value; 
         $operation=getRadioVal("operation"); 
         if (isNaN($time) || $time=="") { 
                     alert("請(qǐng)正確設(shè)定一個(gè)時(shí)間值!     "); 
                     getObject("time").select(); 
                     return; 
         } 
         else { 
                     $time=$time.parseInt(); 
                     if ($mod_time=="mod_minute") { $time=$time*60; }          
         } 
         getObject("time").disabled=true; 
         getObject("mod_time").disabled=true; 
         chStatus("operation",true); 
         getObject("StartButton").disabled=true; 
         getObject("StopButton").disabled=false; 
         Timer_Kernel(); 



function OperateWin32($DownFlag) { 
         $OS_Pro=GetObject("WinMgmts:{(shutdown)}//./root/cimv2").ExecQuery("select * from win32_operatingsystem where primary=true"); 
         for ($e=new Enumerator($OS_Pro);!$e.atEnd();$e.moveNext()) { 
                     $getProcess=$e.item() 
                     $getProcess.win32shutdown($DownFlag); 
         } 



function ResponseKeyPress() { 
         if (event.keyCode==13) { event.keyCode=9; } 



//--> 
</Script> 
</head> 


<body> 
         <fieldset> 
                     <table width="100%" border="1" cellpadding="4" cellspacing="3"> 
                     <form name="form1"> 
                             <tr> 
                                     <td width="25%">設(shè)定時(shí)間:</td> 
                                     <td width="75%"><input type="text" name="time" size="20" value="" onkeypress="ResponseKeyPress()" />  
                                                 <select name="mod_time"> 
                                                         <option value="mod_minute">分鐘</option> 
                                                         <option value="mod_second">秒鐘</option> 
                                                 </select> 
                                     </td> 
                             </tr> 
                             <tr> 
                                     <td>功能選擇:</td> 
                                     <td> 
                                                 <input type="radio" name="operation" value="rWin" checked="checked" />重啟 
                                                 <input type="radio" name="operation" value="cWin" />關(guān)機(jī) 
                                     </td> 
                             </tr> 
                             <tr> 
                                     <td colspan="2" style="text-align:right"> 
                                                 <input type="button" name="StartButton" value=" 應(yīng)用 " onclick="Timer_Start()" /> 
                                                 <input type="button" name="StopButton" value=" 取消 " onclick="Timer_Stop()" /> 
                                                 <input type="button" name="ExitButton" value=" 退出 " onclick="Timer_Quit()" /> 
                                     </td> 
                             </tr> 
                     </form> 
                     </table> 
         </fieldset> 
</body> 
</html> 
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 梁平县| 拜城县| 河曲县| 法库县| 探索| 西林县| 丹寨县| 贞丰县| 繁峙县| 乾安县| 广丰县| 鄂州市| 武汉市| 岑溪市| 石棉县| 武宣县| 岐山县| 册亨县| 衢州市| 张家口市| 金溪县| 札达县| 宿松县| 甘谷县| 蒙山县| 资阳市| 大化| 榆社县| 涞水县| 西青区| 景谷| 崇明县| 印江| 盐山县| 西宁市| 临沭县| 龙州县| 绥江县| 内丘县| 富蕴县| 武隆县|