• <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>

    教你做超簡單的vbs百度小助手!

    接下來讓我們一起來學習如何做vbs百度小助手吧!

    操作方式

    • 01

      打開電腦,右鍵單擊選擇新建文本文檔。

    • 02

      成立當作功后,桌面上會呈現新建文本文檔的圖標,雙擊打開。

    • 03

      輸入

      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

    • 04

      輸入完當作后,點擊左上角另存為,把文件名的后綴改為vbs,點擊保留。

    • 05

      如許就做好了,桌面會顯示建造當作功后,桌面呈現了一個以“新建文本文檔.vbs”為文件名的文件,它就是我們建造的百度小助手。

    • 06

      雙擊打開,如下圖所示。

    • End
    • 發表于 2018-07-21 00:00
    • 閱讀 ( 704 )
    • 分類:電腦網絡

    你可能感興趣的文章

    相關問題

    0 條評論

    請先 登錄 后評論
    聯系我們:uytrv@hotmail.com 問答工具
  • <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>
    久久久久精品国产麻豆