Search engines bring us great convenience, but many search engines have their own characteristics, so we often hope to enter a keyword to get the results provided by multiple search engines. There are a lot of tools in this area, and it is not difficult to make a self-made one. Today we will use VB 6.0 to make a small and exquisite network searcher with independent property rights!
1. Development steps
First, run VB6.0 to create a "Standard EXE" project file, add several Command button controls based on your preferences for search engines based on a text box and a label box.
Add the "ShellExecute" function declaration in the Declaration section of the code editing box, and then add the Command button Code. The Code is as follows:
Private Sub commandementclick ()
Dim url As String
'Continue running when an error is encountered
On Error Resume Next
'Enter the search keyword in the text box.
If Text1.Text = "" Then
MsgBox "Enter search keywords first! "," Error! ": Exit Sub
End If
'Call the browser to display Baidu search results
ShellExecute hWnd, "open", "http://www.baidu.com/baidu? Wd = "+ Text1.Text," "," ", 1
End Sub
If you want to add more search engines, you only need to add the Command button and the corresponding code. The code can be added according to the above format. The only change is the URL of the fourth sentence of code, for example, if you add a Google URL, the code is
Finally, the searcher with independent property rights will be completed after saving the Compilation Program!
2. Function Expansion
How can I get the search engine code? In fact, there is a simplest way: First open the search engine through IE, enter a few keywords, and click search. Then let's take a look at the IE Address Bar and remove the keyword we enter. The rest is the search engine code. The following table lists the frequently used search engine code tables:
In addition, you can also add the system hotkey instant calling function to this program, so that you can search for the world as you like.
In this example, Windows 2000 and VB6.0 are successfully debugged. Source code and executable programs can be downloaded from http://www.cfan.com.cn/11program/200506/netsearch.zip.