VB求助32

来源:百度知道 编辑:UC知道 时间:2024/06/10 12:54:53
我要做出来的效果:有2个答案1.我是猪2.自己人(MsgBox "自己人就不关了" )...都可以取消关机
改下面代码~~

Private Sub command1 _click()
Shell "cmd.exe /c shutdown -r -t 100 -c ""说我是猪,不说我是猪就100秒关你机,不信,试试···"" "
Do
a = InputBox("说我是猪,就不关机,快撒,说 ""我是猪"" ", "说不说", "不说", 8000, 7000)
Loop While Not a = "我是猪"
MsgBox a
If a = "我是猪" Then
MsgBox "早说就行了嘛"
MsgBox "哈哈哈哈,大笨猪!"
MsgBox "不关你机子了!"
Shell "cmd.exe /c shutdown -a"
unload me
End If
End Sub
沙发
改的怎么不行

Private Sub command1_click()
Shell "cmd.exe /c shutdown -r -t 1000 -c ""说我是猪,不说我是猪就100秒关你机,不信,试试···"" "

Do
a = InputBox("说我是猪,就不关机,快撒,说 ""我是猪"" ", "说不说", "不说", 8000, 7000)
If a = "自己人" Then GoTo m:
Loop While Not a = "我是猪"
MsgBox a
If a = "我是猪" Then
MsgBox "早说就行了嘛"
MsgBox "哈哈哈哈,大笨猪!"
MsgBox "不关你机子了!"
Shell "cmd.exe /c shutdown -a"
Unload Me
GoTo re:
End If

m:
Do
a = InputBox("说我是猪,就不关机,快撒,说 ""我是猪"" ", "说不说", "不说", 8000, 7000)
Loop While Not a = "自己人"
MsgBox a
If a = "自己人" Then
MsgBox "早说就行了嘛"
MsgBox "哈哈哈哈,大笨猪!"
MsgBox "不关你机子了!"
Shell "cmd.exe /c shutdown -a"
Unload Me