我收到此代码的编译错误:
Public Sub CommandButton1_Click()
If TextBox1.Text = "log off" Then
Shell "cmd.exe /c shutdown -l", vbHide: TextBox2.Text = "Logging off"
If TextBox1.Text = "shutdown" Then
Shell "cmd.exe /c shutdown -s", vbHide: TextBox2.Text = "Shutting Down"
If TextBox1.Text = "restart" Then
Shell "cmd.exe /c shutdown -r", vbHide: TextBox2.Text = "Restarting"
Else
MsgBox "Command Not Defined",vbCritical
End Sub
Run Code Online (Sandbox Code Playgroud)
现在它出现了"阻止如果没有结束如果"的错误消息.为什么?