hta實(shí)現(xiàn)的定時(shí)關(guān)機(jī)小程序
發(fā)布日期:2021-12-19 00:50 | 文章來(lái)源:源碼之家
定時(shí)關(guān)機(jī)小程序
界面:
實(shí)現(xiàn)代碼:
復(fù)制代碼 代碼如下:
<head>
<title>定時(shí)關(guān)機(jī)小程序</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 "請(qǐng)輸入一個(gè)有效的數(shù)字。"
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 分鐘后關(guān)閉計(jì)算機(jī)" 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 分鐘后關(guān)閉計(jì)算機(jī)" 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 分鐘后關(guān)閉計(jì)算機(jī)" name="run_button" onClick="ThrSub"><p> </div></center>
<br>
自定義時(shí)間(分鐘):<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="取消計(jì)劃中的注銷" name="run_button" onClick="EShutDown"><p> </div></center>
<center><div><input type="button" style="height:30px;line-height:20px;border:1px solid #aaa;" value=" 關(guān)閉計(jì)算機(jī) " name="run_button" onClick="ShutDown"><p> </div></center>
<br>
<center><div><a >http://www.enun.net/</a></div></center>
</body>
版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。
相關(guān)文章