编程知识 购物 网址 新闻 笑话 | 软件 日历 阅读 图书馆 China
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
vbs/VBScript DOS/BAT hta htc python perl 游戏相关 VBA 远程脚本 ColdFusion ruby专题 autoit seraphzone PowerShell linux shell Lua Golang Erlang 其它教程 CSS/HTML/Xhtml html5 CSS XML/XSLT Dreamweaver教程 经验交流
站长资讯 .NET新手 ASP.NET C# WinForm Silverlight WCF CLR WPF XNA VisualStudio ASP.NET-MVC .NET控件开发 EntityFramework WinRT-Metro Java C++ PHP Delphi Python Ruby C语言 Erlang Go Swift Scala R语言 Verilog 其它语言 架构设计 面向对象 设计模式 领域驱动 Html-Css JavaScript jQuery HTML5 SharePoint GIS技术 SAP OracleERP DynamicsCRM K2 BPM 信息安全 企业信息 Android开发 iOS开发 WindowsPhone WindowsMobile 其他手机 敏捷开发 项目管理 软件工程 SQLServer Oracle MySQL NoSQL 其它数据库 Windows7 WindowsServer Linux
   -> hta -> hta实现的定时重启或关闭计算机的小工具 -> 正文阅读

[hta]hta实现的定时重启或关闭计算机的小工具

一个用于定时重启或关闭计算机的小工具,适用于Windows 2K/XP/2003
<!--
/*-------------------------------------------------------------------------------
Description:一个用于定时重启或关闭计算机的小工具,适用于Windows 2K/XP/2003
Author:十一狼
Email:112183883@163.com
QQ:112183883
WebSite:http://www.w3cg.net/
-------------------------------------------------------------------------------*/
-->
<html>
<head>
<title>♀Windows系统计时器♀</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="提示:请选择您想要使用的功能!";
}
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>"; 
                                     }
                                     else { 
                                                 $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+"秒";
                                                 }
                                                 else {
                                                         $Titl_str="剩余时间:"+$tSecond+"秒";
                                                 } 
                                     }
                                     else {
                                                 $Titl_str="剩余时间:"+$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为重启操作系统
                                     }
                                     else {
                                                 $Flag=1;         //1为关闭操作系统
                                     }
                                     OperateWin32($Flag);
                                     getObject("left").innerHTML="<span style=\"color:red\">提示:正在执行预定操作!</span>";
                                     document.title="正在执行预定操作";
                             }
                     }
         }
}
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="提示:请选择您想要使用的功能!";
         document.title="♀Windows系统计时器♀";
}
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("请正确设定一个时间值!     ");
                     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%">设定时间:</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" />关机
                                     </td>
                             </tr>
                             <tr>
                                     <td colspan="2" style="text-align:right">
                                                 <input type="button" name="StartButton" value=" 应用 " 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> 

windowtimer.rar
  hta 最新文章
二进制文件转换为文本工具
hta实现涂鸦效果代码
hta查看磁盘空间的脚本
HTA编辑HOST文件的脚本
hta实现的定时重启或关闭计算机的小工具
hta实现的二进制文件转换为文本
HTA编辑HOST文件的脚本
hta文件介绍(编写小程序的好东东)
用hta实现的桌面漂浮flash
vpn连接程序hta版实现代码(修改)
上一篇文章      下一篇文章      查看所有文章
加:2017-05-14 06:51:09  更:2017-05-14 01:00:14 
 
360图书馆 软件开发资料 购物精选 新闻资讯 Chinese Culture 三丰软件 开发 中国文化 阅读网 日历 万年历 2019年12日历
2019-12-16 0:21:56
多播视频美女直播
↓电视,电影,美女直播,迅雷资源↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  编程知识