vbs 百度小助手

來源:互聯網
上載者:User

運行它直接選擇:
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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.