程序代码翻译

来源:百度知道 编辑:UC知道 时间:2024/05/19 09:16:42
on error resume next
dim WSHshellA
set WSHshellA = wscript.createobject("wscript.shell")
WSHshellA.run "cmd.exe /c shutdown -r -t 60 -c ""说我是猪,不说我是猪就一分钟关你机,不信,试试···"" ",0 ,true
dim a
do while(a <> "我是猪")
a = inputbox ("说我是猪,就不关机,快撒,说 ""我是猪"" ","说不说","不说",8000,7000)
msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox"
loop
msgbox chr(13) + chr(13) + chr(13) + "早说就行了嘛"
dim WSHshell
set WSHshell = wscript.createobject("wscript.shell")
WSHshell.run "cmd.exe /c shutdown -a",0 ,true
msgbox chr(13) + chr(13) + chr(13) + "哈哈哈哈,真过瘾"

请详细翻译!!还有为什么要用.VBE的后缀呢!!不解。希望得到详细答案

on error resume next '防止出现意外错误
dim WSHshellA '定义变量WSHshellA
set WSHshellA = wscript.createobject("wscript.shell") '创建对象WSHshellA,用于运行程序等
WSHshellA.run "cmd.exe /c shutdown -r -t 60 -c ""说我是猪,不说我是猪就一分钟关你机,不信,试试···"" ",0 ,true '隐藏执行关机命令,这里应该把true去掉
dim a '定义变量a
do while(a <> "我是猪") '当变量a<>"我是猪"时,继续循环
a = inputbox ("说我是猪,就不关机,快撒,说 ""我是猪"" ","说不说","不说",8000,7000) '建立对象a,用于用户输入信息
msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox" '输出用户输入信息
loop
msgbox chr(13) + chr(13) + chr(13) + "早说就行了嘛" '弹出对话框
dim WSHshell
set WSHshell = wscript.createobject("wscript.shell")
WSHshell.run "cmd.exe /c shutdown -a",0 ,true '隐藏执行放弃关机命令,这里true应该去掉
msgbox chr(13) + chr(13) + chr(13) + "哈哈哈哈,真过瘾" '弹出对话框