HTA里如何脚本延迟?
vbs里是wscript.sleep
hta 里如何做到呢?
vbs里是wscript.sleep
hta 里如何做到呢?
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
<script language="vbscript">
set fso = createobject("scripting.filesystemobject")
set stream = fso.opentextfile("sleep.vbs",2,true)
call stream.write("call wscript.sleep(1000)")
call stream.close()
set shell = createobject("wscript.shell")
call shell.run("sleep.vbs",0,true)
call msgbox("hello world!")
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>My HTML Application</title>
<script language="vbscript">
Sub sleep(t)
OpFile 1,t
CreateObject("WScript.Shell").run "sleep.vbs",0,True
msgbox("hello world!")
OpFile 0,0
End Sub
Sub OpFile(n,t)
Set fso=createobject("scripting.filesystemobject")
If n=1 Then
Set stream = fso.opentextfile("sleep.vbs",2,true)
stream.write "wscript.sleep("&t&")"
stream.close()
Set stream=Nothing
Else
fso.DeleteFile "sleep.vbs"
End If
Set fso=Nothing
End Sub
</script>
<hta:application
applicationname="MyHTA"
border="dialog"
borderstyle="normal"
caption="My HTML Application"
contextmenu="no"
icon="myicon.ico"
maximizebutton="no"
minimizebutton="yes"
navigable="no"
scroll="no"
selection="no"
showintaskbar="yes"
singleinstance="yes"
sysmenu="yes"
version="1.0"
windowstate="normal"
>
</head>
<body>
<input class="button" TYPE=BUTTON value="TestButton" name="btnTestButton" onClick="sleep(3000)">
</body>
</html>