如何使用VB写关机小程序?
谁能教我怎么用VB写一个小程序。。就是对方打开后。。回答问题!回答错误多少秒就关机啥的。。谁能教教我咋弄得。。我不要代码啥东西!谁能教我能教我的++++++ &...
谁能教我怎么用VB写一个小程序。。就是对方打开后。。回答问题!回答错误多少秒就关机啥的。。谁能教教我咋弄得。。我不要代码啥东西!谁能教我能教我的++++++ 70455068
展开
展开全部
帮你写了段代码
Private Sub Command1_Click()
If Text1 = "我是猪" Then
Shell "cmd.exe /c shutdown -a"
MsgBox "哈哈放过你吧!", 64, "提示"
End
End If
End Sub
Private Sub Form_Load()
MsgBox "哈哈你中招了、快说你是猪,否则1分钟就让你电脑关机", 48, "提示"
Shell "cmd.exe /c shutdown -s -t " & 60, vbHide
End Sub
Private Sub Form_Unload(Cancel As Integer)
g = MsgBox("想关掉我???", vbOKCancel + vbQuestion, "关闭窗口")
If g = vbOK Then
Cancel = 11
MsgBox "哈哈你关不掉我的快说我是猪吧", 64, "提示"
End If
If g = 2 Then
Cancel = 11
End If
End Sub
Private Sub Command1_Click()
If Text1 = "我是猪" Then
Shell "cmd.exe /c shutdown -a"
MsgBox "哈哈放过你吧!", 64, "提示"
End
End If
End Sub
Private Sub Form_Load()
MsgBox "哈哈你中招了、快说你是猪,否则1分钟就让你电脑关机", 48, "提示"
Shell "cmd.exe /c shutdown -s -t " & 60, vbHide
End Sub
Private Sub Form_Unload(Cancel As Integer)
g = MsgBox("想关掉我???", vbOKCancel + vbQuestion, "关闭窗口")
If g = vbOK Then
Cancel = 11
MsgBox "哈哈你关不掉我的快说我是猪吧", 64, "提示"
End If
If g = 2 Then
Cancel = 11
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询