早教吧 育儿知识 作业答案 考试题库 百科 知识分享

英语翻译onerrorresumenextdimWSHshellAsetWSHshellA=wscript.createobject("wscript.shell")WSHshellA.run"cmd.exe/cshutdown-r-t60-c""说我是猪,不说我是猪就一分钟关你机,不信,试试···""",0,truedimadowhile(a"

题目详情
英语翻译
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) + "哈哈哈哈,真过瘾" '弹出对话框