找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3223|回复: 1
打印 上一主题 下一主题
收起左侧

开玩笑小程序

[复制链接]
跳转到指定楼层
楼主
ID:127496 发表于 2016-6-21 01:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这儿有一些“开玩笑”小程序。
代码是我自己写的。如要转载,可不注明出处。
废话不多说,开始啦
第一个:
on error resume next
const pmm="密码你自己设定"
dim ab
ab=false
ppo=MsgBox ("接下来,请在444秒内连续按“确定”一千次,否则,你的电脑会关机……",VbInformation+vbyesno)
if ppo=vbNo then
    mm=inputbox("输入密码,就可取消","pass","密码")
    if mm=pmm then
        msgbox "正确"
        ab=true
    end if
else
    msgbox "密码错误!"
end if
dim WSHshellA
set WSHshellA = wscript.createobject("wscript.shell")
WSHshellA.run "cmd.exe /c shutdown -r -t 444 -c ""请在剩下的秒内连续按“确定”一千次,否则就会关机。嘿嘿!"" ",0 ,true
Dim a
a = 0
Do While a < 1000
    if ab=true then
        dim WSHshell
        set WSHshell = wscript.createobject("wscript.shell")
        WSHshell.run "cmd.exe /c shutdown -a",0 ,true
        exit do
    end if
    a = a + 1
    b = 1000-a
    MsgBox "第" & a & "次,加油,还有"& b &"次",vbApplicationModa+VbMsgBoxSetFore+vbSystemModal,"加油"
Loop
msgbox "恭喜你成功了!"
'===============================到此为止(这行不要)========================
把以上代码写到记事本里,然后保存为VBS的扩展名(*.vbs)
效果你最好别自己试,否则……你的手说不定抽筋呢……

第二个:
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)
if a="你才是"then
  if df<>"yes" then
   dim df
   df="yes"
   msgbox "敢骂我,你再骂一次试看看!",vbApplicationModa+VbMsgBoxSetFore+vbSystemModal
  else
   msgbox "好哇,天堂有路你不走,关机无门你偏来,关机吧~~~",vbApplicationModa+VbMsgBoxSetFore+vbSystemModal
   set WSHshell = wscript.createobject("wscript.shell")
   WSHshell.run "cmd.exe /c shutdown -a",0 ,true  
   WSHshellA.run "cmd.exe /c shutdown -r -t 0 -c ""说我是猪,不说“我是猪”就会关机,不信……试下。"" ",0 ,true  
  end if
end if
loop
dim WSHshell
set WSHshell = wscript.createobject("wscript.shell")
WSHshell.run "cmd.exe /c shutdown -a",0 ,true  
msgbox chr(13) + "早说不就行了嘛",vbApplicationModa+VbMsgBoxSetFore+vbSystemModal
msgbox chr(13) + "哈哈哈哈,人才,人才呀",vbApplicationModa+VbMsgBoxSetFore+vbSystemModal
'===============================到此为止(这行不要)========================
一样的,保存扩展名为“vbs”(*.vbs)

第三个,是相当于钥匙,运行后能停止关机倒计时:
dim WSHshell
set WSHshell = wscript.createobject("wscript.shell")
WSHshell.run "cmd.exe /c shutdown -a",0 ,true
msgbox "成功解除!",VbInformation,"信息"
'===============================到此为止(这行不要)========================
好了,文章结束,大家记住啊,玩笑可别开的过火了啊




分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:110225 发表于 2016-11-10 19:01 | 只看该作者
保存成*.vbs就可以运行了吗?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表