有没有办法让MessageBox在设定的时间间隔后自动解除?

sw1*_*sw1 3 vbscript

我有一个VBScript来警告一个带有MessageBox的事件,但是我想在5秒左右后自动关闭它.有没有办法实现这个目标?

Nil*_*lpo 9

使用WshShell对象的Popup方法.它有一个超时参数.

intTimeout = 10      'Number of seconds to wait
strMessage = "This is my message box!"
strTitle = "Hello, world!"

Set WshShell = CreateObject("WScript.Shell")
intResult = WshShell.Popup(strMessage, intTimeout, strTitle)
Run Code Online (Sandbox Code Playgroud)

有关更多信息,请查看我的文章掌握 ASP Free上的MessageBox.