
将以下文字粘贴到记事本上后将后缀名改为:vbe,然后双击即可!(里面的那些词语可以自行修改),经测试肯定可以使用。
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) + "承认就好了嘛"
阻止关机的方法:按键盘上的Win键+R键,在出来的窗口中输入:shutdown -a 再按回车即可取消关机命令。
Dim a, bPrivate Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Text.Text = "Visual Basic程序设计"
Command1.Caption = "结束"
Text.Left = 0: Text.Top = 0: Text.Width = 0.5 * Form1.Width
Text.Height = 0.5 * Form1.Height
a = Form1.Width - Command1.Left
b = Form1.Height - Command1.Top
End Sub
Private Sub Form_Resize()
Text.Left = 0: Text.Top = 0: Text.Width = 0.5 * Form1.Width
Text.Height = 0.5 * Form1.Height
Command1.Left = Form1.Width - a
Command1.Top = Form1.Height - b
End Sub
注意,各变量名,控件名保持一致,你题目中的文本框名称为text
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)