午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    hta 定時(shí)關(guān)機(jī)重啟實(shí)現(xiàn)代碼
    來源:易賢網(wǎng) 閱讀:1057 次 日期:2016-06-24 10:15:04
    溫馨提示:易賢網(wǎng)小編為您整理了“hta 定時(shí)關(guān)機(jī)重啟實(shí)現(xiàn)代碼”,方便廣大網(wǎng)友查閱!

    代碼如下:

    <html>

    <head>

    <meta http-equiv=content-type content=text/html;charset=gb2312>

    <title>一個(gè)用于定時(shí)重啟或關(guān)閉計(jì)算機(jī)的小工具,適用于windows 2k/xp/2003 </title>

    <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>

    <div id=footerinfo>

    <div id=left></div>

    <div id=right>

    作者:黑蝦

    </div>

    </div>

    </body>

    </html>

    如果保存后發(fā)現(xiàn)不能運(yùn)行一般是編碼的問題,可以用記事本保存

    更多信息請(qǐng)查看腳本欄目
    易賢網(wǎng)手機(jī)網(wǎng)站地址:hta 定時(shí)關(guān)機(jī)重啟實(shí)現(xiàn)代碼
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2025國考·省考課程試聽報(bào)名

    • 報(bào)班類型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專用圖標(biāo)