VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Search the Internet with 8 common search engines

by Hyperswede (3 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (38 Votes)

Search the internet for web pages or files from your VB App.
8 common search engines:
AltaVista, Excite, HotBot, Infoseek, Lycos, Yahoo, SoftSeek, AudioFind
An easy to use function.
You can add as many Search Engines to the Search-engine list as you want, this list contains 8 search-engines. One of my lists contain 24 common search-engines.
Use like this:
SearchTheWeb Inputbox("Enter search-words:","",""), wAltaVista

Inputs
Just specify the search engine and words to search for.
Code Returns
Opens your web browser to a page showing the results of your search.
API Declarations
It's all in the source code below.

Rate Search the Internet with 8 common search engines

Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As _
String, ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'The Search-Engine list:
Const SearchEngineList As String = "http://www.altavista.digital.com/cgi-bin/query?pg=q&what=web&fmt=.&q=||http://www.excite.com/search.gw?c=web&search=||http://www.hotbot.com/?SW=web&SM=MC&MT=||http://guide-p.infoseek.com/Titles?qt=|&col=WW&sv=IS&lk=noframes|http://www.lycos.com/cgi-bin/pursuit?query=||http://search.yahoo.com/bin/search?p=||http://search02.softseek.com/cgi-bin/search.cgi?keywords=|&seekindex=index&maxresults=025&cb=|http://www.audiofind.com:70/?audiofindsearch=|&audiofindtype="
Const wAltaVista As Long = 1
Const wExcite As Long = 3
Const wHotBot As Long = 5
Const wInfoseek As Long = 7
Const wLycos As Long = 9
Const wYahoo As Long = 11
Const wSoftSeek As Long = 13
Const wAudioFind As Long = 15
Function PartOfString(Str As String, Seperator As String, Number As Long)
Dim Current, Temp, Full
Current = 1
For q = 1 To Len(Str)
Temp = Mid(Str, q, 1)
If Temp = Seperator Then Current = Current + 1
If Current = Number And Not Temp = Seperator Then Full = Full & Temp
Next q
PartOfString = Full
End Function
Sub SearchTheWeb(ForWhat As String, WithWhat As Long)
ret& = ShellExecute(Me.hwnd, "Open", PartOfString(SearchEngineList, "|", WithWhat) & ForWhat & PartOfString(SearchEngineList, "|", WithWhat + 1), "", App.Path, 1)
End Sub

Download this snippet    Add to My Saved Code

Search the Internet with 8 common search engines Comments

No comments have been posted about Search the Internet with 8 common search engines. Why not be the first to post a comment about Search the Internet with 8 common search engines.

Post your comment

Subject:
Message:
0/1000 characters