网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的范文:

 

标题 hta实现的定时关机小程序
范文
    定时关机小程序
    界面:
    代码如下:
    <head>
    <title>定时关机小程序</title>
    <hta:application
         applicationname=hta test
      borde=thin
      borderstyle=raised
      icon=c:\windows\system32\control.exe
         scroll=no
         singleinstance=yes
      maximizebutton=no
      minimizebutton=no
         windowstate=normal
    >
    </head>
    <script language=vbscript>
     sub window_onload
      strcomputer = .
      set objwmiservice = getobject(winmgmts:\\ & strcomputer & \root\cimv2)
      set colitems = objwmiservice.execquery(select * from win32_desktopmonitor)
      for each objitem in colitems
       inthorizontal = objitem.screenwidth
       intvertical = objitem.screenheight
      next
      intleft = (inthorizontal - 240) / 2
      inttop = (intvertical - 500) / 2
      window.resizeto 240,500
      window.moveto intleft, inttop
     end sub
        sub onesub
      set objectshell=createobject(wscript.shell)
      ireturn = objectshell.run(shutdown -s -f -t 1800, 0, true)
        end sub
        sub twosub
      set objectshell=createobject(wscript.shell)
      ireturn = objectshell.run(shutdown -s -f -t 2700, 0, true)
        end sub
        sub thrsub
      set objectshell=createobject(wscript.shell)
      ireturn = objectshell.run(shutdown -s -f -t 3600, 0, true)
        end sub
     sub ok
      if isnumeric(text.value) then
       overtime = text.value * 60
       set objectshell=createobject(wscript.shell)
       ireturn = objectshell.run(shutdown -s -f -t & overtime, 0, true)
      else
       msgbox 请输入一个有效的数字。
      end if
        end sub
        sub shutdown
      set objectshell=createobject(wscript.shell)
      ireturn = objectshell.run(shutdown -s -t 0, 0, true)
        end sub
        sub eshutdown
      set objectshell=createobject(wscript.shell)
      ireturn = objectshell.run(shutdown -a, 0, true)
        end sub
    </script>
    <body>
    <br>
    <center><div><input type=button style=height:30px;line-height:20px;border:1px solid #aaa; value=30 分钟后关闭计算机 name=run_button onclick=onesub><p> </div></center>
    <center><div><input type=button style=height:30px;line-height:20px;border:1px solid #aaa; value=45 分钟后关闭计算机 name=run_button onclick=twosub><p> </div></center>
    <center><div><input type=button style=height:30px;line-height:20px;border:1px solid #aaa; value=60 分钟后关闭计算机 name=run_button onclick=thrsub><p> </div></center>
    <br>
     自定义时间(分钟):<p>
     <input type=text name=text id=text style=height:23px;width:120px;line-height:20px;border:1px solid #aaa;/> 
    <input name=submit type=submit style=width:50px;height:23px;line-height:20px;border:1px solid #aaa; value=确定 onclick=ok><p>
    <br>
    <center><div><input type=button style=height:30px;line-height:20px;border:1px solid #aaa; value=取消计划中的注销 name=run_button  onclick=eshutdown><p> </div></center>
    <center><div><input type=button style=height:30px;line-height:20px;border:1px solid #aaa; value= 关闭计算机 name=run_button  onclick=shutdown><p> </div></center>
    <br>
    <center><div><a href=http://www.enun.net/>http://www.enun.net/</a></div></center>
    </body>
随便看

 

在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/23 13:17:12