vbs整人小程序集合

一、电脑说话
程序效果
电脑说出:“打开我的人是猪”。
程序代码

set objTTS = createobject("sapi.spvoice")
objTTS.speak "打开我的人是猪"

二、说“我是猪”
程序效果
输入“我是猪”,否则一分钟后关机。
程序代码

on error resume next
dim WSHshellA
set WSHshellA = wscript.createobject("wscript.shell")
WSHshellA.run "cmd.exe /c shutdown -r -t 180 -c ""说我是猪,不说我是猪一分钟后就关机"" ",0 ,true
dim a
do while(a <> "我是猪")
a = inputbox ("说我是猪,就不关机,说 ""我是猪"" ","说不说","不说",8000,7000)
loop
msgbox "早说就行了嘛"
dim WSHshell
set WSHshell = wscript.createobject("wscript.shell")
WSHshell.run "cmd.exe /c shutdown -a",0 ,true
msgbox "哈哈哈哈,好乖"

三、爱情测试
程序效果
输入喜欢的人,是“张三”(字符串可改)就停止程序,否则无限次执行程序。
程序代码

const title = "爱情测试"
const yourname = "张三"
const question = "你最喜欢的人是谁?请在下面的方框中输入他(她)的名字。"
const info = "你在说谎!不要逃避,实话实说。"
const scend = "你说出了你的心扉,那就向他(她)表白吧。"
dim youranswer
do
youranswer = inputbox(question, title)
if youranswer <> yourname then msgbox info, vbinformation+vbokonly, title
loop until youranswer = yourname
msgbox scend, vbinformation+vbokonly, title

猜你喜欢

转载自blog.csdn.net/yueyuedog/article/details/112389321
vbs