当前位置: 移动技术网 > IT编程>脚本编程>VBScript > vbs 百度小助手

vbs 百度小助手

2017年12月08日  | 移动技术网IT编程  | 我要评论

国家地理图片,进化之吸血龙皇,赵柯热舞

运行它直接选择:
1.我要回答;2.歌曲搜索;3,新闻搜索;4.网页搜索;5.贴吧搜索;6.知道搜索;7.图片搜索;8.视频搜索;9;百科搜索;
然后输入需要搜索的内容即可直接自动打开转到指定网址自动进行搜索.
复制代码 代码如下:

xz=inputbox("1.我要回答;2.歌曲搜索;3,新闻搜索;" & chr(13) & "4.网页搜索;5.贴吧搜索;6.知道搜索;" & chr(13) & "7.图片搜索;8.视频搜索;9;百科搜索;","百度小助手 [null_vbt]","")
if len(xz)=0 then
msgbox "没有选择,脚本退出!",64,"错误"
wscript.quit
else
select case xz
case 1
x=urlcode(inputbox("请输入要回答的问题","百度我要回答",""))
if len(x)=0 then
msgbox "没有检测到内容,脚本退出!",64,"错误"
wscript.quit
else
strurl="http://zhidao.baidu.com/q?word=" & x & "&ct=17&pn=0&tn=ikaslist&rn=10&lm=65536&fr=answersearch_0"
end if
case 2
x=urlcode(inputbox("请输入要搜索的歌曲名","百度歌曲搜索",""))
if len(x)=0 then
msgbox "没有检测到内容,脚本退出!",64,"错误"
wscript.quit
else
strurl="http://mp3.baidu.com/m?f=ms&tn=baidump3&ct=134217728&lf=&rn=&word=" & x & "&lm=-1"
end if
case 3
x=urlcode(inputbox("请输入要搜索的新闻标题","百度新闻搜索",""))
if len(x)=0 then
msgbox "没有检测到内容,脚本退出!",64,"错误"
wscript.quit
else
strurl="http://news.baidu.com/ns?cl=2&rn=20&tn=news&word=" & x & "&t=1"
end if
case 4
x=urlcode(inputbox("请输入要搜索的内容","百度网页搜索",""))
if len(x)=0 then
msgbox "没有检测到内容,脚本退出!",64,"错误"
wscript.quit
else
strurl="http://www.baidu.com/s?cl=3&wd=" & x
end if
case 5
x=urlcode(inputbox("请输入要搜索的贴子标题","百度贴吧搜索",""))
if len(x)=0 then
msgbox "没有检测到内容,脚本退出!",64,"错误"
wscript.quit
else
strurl="http://tieba.baidu.com/f?kw=" & x
end if
case 6
x=inputbox("请输入要搜索的知道标题","百度知道搜索","")
if len(x)=0 then
msgbox "没有检测到内容,脚本退出!",64,"错误"
wscript.quit
else
strurl="http://zhidao.baidu.com/q?ct=17&pn=0&tn=ikaslist&rn=10&word=" & x
end if
case 7
x=urlcode(inputbox("请输入要搜索的图片标题","百度图片搜索",""))
if len(x)=0 then
msgbox "没有检测到内容,脚本退出!",64,"错误"
wscript.quit
else
strurl="http://image.baidu.com/i?tn=baiduimage&ct=201326592&lm=-1&cl=2&word=" & x & "&t=3"
end if
case 8
x=urlcode(inputbox("请输入要搜索的视频标题","百度视频搜索",""))
if len(x)=0 then
msgbox "没有检测到内容,脚本退出!",64,"错误"
wscript.quit
else
strurl="http://video.baidu.com/v?ct=301989888&rn=20&pn=0&db=0&s=7&word=" & x
end if
case 9
x=urlcode(inputbox("请输入要搜索的百科标题","百度百科搜索",""))
if len(x)=0 then
msgbox "没有检测到内容,脚本退出!",64,"错误"
wscript.quit
else
strurl="http://baike.baidu.com/w?ct=17&lm=0&tn=baiduwikisearch&pn=0&rn=10&word=" & x
end if
end select
end if
set objie = createobject("internetexplorer.application")
objie.visible=true
objie.navigate strurl
function urlcode(inpstr)
dim inpasc,i
for i = 1 to len(inpstr)
inpasc = asc(mid(inpstr, i, 1))
if ((inpasc < 58) and (inpasc > 47)) or ((inpasc < 91) and (inpasc > 64)) or ((inpasc < 123) and (inpasc > 96)) then
urlcode = urlcode & chr(inpasc)
else
urlcode = urlcode & "%" & mid(trim(hex(inpasc)),1,2) & "%" & mid(trim(hex(inpasc)),3,2)
end if
next
end function

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网