home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Visual Basic new SourceCode and Projects / AllinoneSearchEngine / Form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-10-09  |  13.5 KB  |  413 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "All-In-1 Search Engine"
  5.    ClientHeight    =   4560
  6.    ClientLeft      =   45
  7.    ClientTop       =   585
  8.    ClientWidth     =   6960
  9.    Icon            =   "Form1.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   4560
  14.    ScaleWidth      =   6960
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.OptionButton Option1 
  17.       Caption         =   "AudioGalaxy"
  18.       Height          =   255
  19.       Index           =   16
  20.       Left            =   2040
  21.       TabIndex        =   28
  22.       Top             =   2400
  23.       Width           =   1455
  24.    End
  25.    Begin VB.OptionButton Option1 
  26.       Caption         =   "Audiofind"
  27.       Height          =   255
  28.       Index           =   15
  29.       Left            =   2040
  30.       TabIndex        =   27
  31.       Top             =   2040
  32.       Width           =   1455
  33.    End
  34.    Begin VB.Frame Frame6 
  35.       Caption         =   "MP3 Searches"
  36.       Height          =   975
  37.       Left            =   1920
  38.       TabIndex        =   26
  39.       Top             =   1800
  40.       Width           =   3135
  41.    End
  42.    Begin VB.OptionButton Option1 
  43.       Caption         =   "CTNet"
  44.       Enabled         =   0   'False
  45.       Height          =   255
  46.       Index           =   14
  47.       Left            =   240
  48.       TabIndex        =   25
  49.       Top             =   2400
  50.       Width           =   1455
  51.    End
  52.    Begin VB.OptionButton Option1 
  53.       Caption         =   "Tucows"
  54.       Height          =   255
  55.       Index           =   13
  56.       Left            =   240
  57.       TabIndex        =   24
  58.       Top             =   2040
  59.       Width           =   1455
  60.    End
  61.    Begin VB.Frame Frame5 
  62.       Caption         =   "File Searches"
  63.       Height          =   975
  64.       Left            =   120
  65.       TabIndex        =   23
  66.       Top             =   1800
  67.       Width           =   1695
  68.    End
  69.    Begin VB.Frame Frame4 
  70.       Caption         =   "Search Engine"
  71.       Height          =   1095
  72.       Left            =   120
  73.       TabIndex        =   16
  74.       Top             =   2880
  75.       Width           =   6735
  76.       Begin VB.TextBox Text1 
  77.          Height          =   285
  78.          Left            =   1658
  79.          TabIndex        =   18
  80.          Top             =   285
  81.          Width           =   3015
  82.       End
  83.       Begin VB.CommandButton cmdSearch 
  84.          Caption         =   "&Search"
  85.          Default         =   -1  'True
  86.          Enabled         =   0   'False
  87.          BeginProperty Font 
  88.             Name            =   "MS Sans Serif"
  89.             Size            =   8.25
  90.             Charset         =   0
  91.             Weight          =   700
  92.             Underline       =   0   'False
  93.             Italic          =   0   'False
  94.             Strikethrough   =   0   'False
  95.          EndProperty
  96.          Height          =   375
  97.          Left            =   4778
  98.          TabIndex        =   21
  99.          Top             =   240
  100.          Width           =   1575
  101.       End
  102.       Begin VB.Label Label2 
  103.          AutoSize        =   -1  'True
  104.          Caption         =   "Coded String:"
  105.          Height          =   195
  106.          Left            =   600
  107.          TabIndex        =   19
  108.          Top             =   720
  109.          Width           =   960
  110.       End
  111.       Begin VB.Label Escaped 
  112.          Height          =   255
  113.          Left            =   1680
  114.          TabIndex        =   20
  115.          Top             =   720
  116.          Width           =   4695
  117.       End
  118.       Begin VB.Label Label1 
  119.          AutoSize        =   -1  'True
  120.          Caption         =   "Search &For:"
  121.          Height          =   195
  122.          Left            =   600
  123.          TabIndex        =   17
  124.          Top             =   300
  125.          Width           =   825
  126.       End
  127.    End
  128.    Begin VB.OptionButton Option1 
  129.       Caption         =   "SavySearch"
  130.       Height          =   255
  131.       Index           =   12
  132.       Left            =   5280
  133.       TabIndex        =   15
  134.       Top             =   600
  135.       Width           =   1455
  136.    End
  137.    Begin VB.OptionButton Option1 
  138.       Caption         =   "MetaCrawler"
  139.       Height          =   255
  140.       Index           =   11
  141.       Left            =   5280
  142.       TabIndex        =   14
  143.       Top             =   240
  144.       Width           =   1455
  145.    End
  146.    Begin VB.OptionButton Option1 
  147.       Caption         =   "Excite"
  148.       Height          =   255
  149.       Index           =   6
  150.       Left            =   2040
  151.       TabIndex        =   9
  152.       Top             =   1320
  153.       Width           =   1455
  154.    End
  155.    Begin VB.OptionButton Option1 
  156.       Caption         =   "Lycos"
  157.       Height          =   255
  158.       Index           =   5
  159.       Left            =   2040
  160.       TabIndex        =   8
  161.       Top             =   960
  162.       Width           =   1455
  163.    End
  164.    Begin VB.OptionButton Option1 
  165.       Caption         =   "Open Text"
  166.       Height          =   255
  167.       Index           =   4
  168.       Left            =   2040
  169.       TabIndex        =   7
  170.       Top             =   600
  171.       Width           =   1455
  172.    End
  173.    Begin VB.OptionButton Option1 
  174.       Caption         =   "Alta Vista"
  175.       Height          =   255
  176.       Index           =   3
  177.       Left            =   2040
  178.       TabIndex        =   6
  179.       Top             =   240
  180.       Width           =   1455
  181.    End
  182.    Begin VB.OptionButton Option1 
  183.       Caption         =   "Inktomi"
  184.       Height          =   255
  185.       Index           =   10
  186.       Left            =   3480
  187.       TabIndex        =   13
  188.       Top             =   1320
  189.       Width           =   1455
  190.    End
  191.    Begin VB.OptionButton Option1 
  192.       Caption         =   "DejaNews"
  193.       Height          =   255
  194.       Index           =   9
  195.       Left            =   3480
  196.       TabIndex        =   12
  197.       Top             =   960
  198.       Width           =   1455
  199.    End
  200.    Begin VB.OptionButton Option1 
  201.       Caption         =   "InfoSeek"
  202.       Height          =   255
  203.       Index           =   8
  204.       Left            =   3480
  205.       TabIndex        =   11
  206.       Top             =   600
  207.       Width           =   1455
  208.    End
  209.    Begin VB.OptionButton Option1 
  210.       Caption         =   "Webcrawler"
  211.       Height          =   255
  212.       Index           =   7
  213.       Left            =   3480
  214.       TabIndex        =   10
  215.       Top             =   240
  216.       Width           =   1455
  217.    End
  218.    Begin VB.OptionButton Option1 
  219.       Caption         =   "Point"
  220.       Height          =   255
  221.       Index           =   2
  222.       Left            =   240
  223.       TabIndex        =   5
  224.       Top             =   960
  225.       Width           =   1455
  226.    End
  227.    Begin VB.OptionButton Option1 
  228.       Caption         =   "Magellan"
  229.       Height          =   255
  230.       Index           =   1
  231.       Left            =   240
  232.       TabIndex        =   4
  233.       Top             =   600
  234.       Width           =   1455
  235.    End
  236.    Begin VB.OptionButton Option1 
  237.       Caption         =   "Yahoo"
  238.       BeginProperty Font 
  239.          Name            =   "MS Sans Serif"
  240.          Size            =   8.25
  241.          Charset         =   0
  242.          Weight          =   700
  243.          Underline       =   0   'False
  244.          Italic          =   0   'False
  245.          Strikethrough   =   0   'False
  246.       EndProperty
  247.       Height          =   255
  248.       Index           =   0
  249.       Left            =   240
  250.       TabIndex        =   3
  251.       Top             =   240
  252.       Value           =   -1  'True
  253.       Width           =   1455
  254.    End
  255.    Begin VB.Frame Frame3 
  256.       Caption         =   "Meta Searches"
  257.       Height          =   1695
  258.       Left            =   5160
  259.       TabIndex        =   2
  260.       Top             =   0
  261.       Width           =   1695
  262.    End
  263.    Begin VB.Frame Frame2 
  264.       Caption         =   "Search Engines"
  265.       Height          =   1695
  266.       Left            =   1920
  267.       TabIndex        =   1
  268.       Top             =   0
  269.       Width           =   3135
  270.    End
  271.    Begin VB.Frame Frame1 
  272.       Caption         =   "Directories"
  273.       Height          =   1695
  274.       Left            =   120
  275.       TabIndex        =   0
  276.       Top             =   0
  277.       Width           =   1695
  278.    End
  279.    Begin VB.CommandButton cmdClose 
  280.       Cancel          =   -1  'True
  281.       Caption         =   "&Close"
  282.       Height          =   375
  283.       Left            =   2640
  284.       TabIndex        =   22
  285.       Top             =   4080
  286.       Width           =   1575
  287.    End
  288.    Begin VB.Menu mnuFile 
  289.       Caption         =   "&File"
  290.       Begin VB.Menu mnuSearch 
  291.          Caption         =   "&Search"
  292.       End
  293.       Begin VB.Menu mnuAbout 
  294.          Caption         =   "&About"
  295.       End
  296.       Begin VB.Menu Space1 
  297.          Caption         =   "-"
  298.       End
  299.       Begin VB.Menu mnuExit 
  300.          Caption         =   "&Exit"
  301.       End
  302.    End
  303. Attribute VB_Name = "Form1"
  304. Attribute VB_GlobalNameSpace = False
  305. Attribute VB_Creatable = False
  306. Attribute VB_PredeclaredId = True
  307. Attribute VB_Exposed = False
  308. 'Api Functions Declaration
  309. 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
  310. 'Variable that contains the seleted Search Engine
  311. Private Selected As Integer
  312. Private Sub cmdSearch_Click()
  313.     Dim S As String
  314. 'Generate the search command string for the selected
  315. 'Search Engine
  316.     Select Case Selected
  317.     Case 0
  318.         S = "http://search.yahoo.com/bin/search?p=" & Escaped.Caption
  319.     Case 1
  320.         S = "http://www.mckinley.com/searcher.cgi?query=" & Escaped.Caption
  321.     Case 2
  322.         S = "http://point.lycos.com/cgi-bin/pursuit?query=" & Escaped.Caption
  323.     Case 3
  324.         S = "http://www.altavista.digital.com/cgi-bin/query?pg=q&what=web&q=" & Escaped.Caption & "&mode=and"
  325.     Case 4
  326.         S = "http://search.opentext.com/omw/simplesearch?SearchFor=" & Escaped.Caption & "&mode=and"
  327.     Case 5
  328.         S = "http://www.lycos.com/cgi-bin/pursuit?query=" & Escaped.Caption + "&backlink=217&maxhits=25"
  329.     Case 6
  330.         S = "http://www.excite.com/search.gw?searchType=Concept&search=" & Escaped.Caption & "&category=default&mode=relevance&showqbe=1&display=html3,hb"
  331.     Case 7
  332.         S = "http://www.webcrawler.com/cgi-bin/WebQuery?searchText=" & Escaped.Caption & "&maxHits=25"
  333.     Case 8
  334.         S = "http://guide-p.infoseek.com/Titles?qt=" & Escaped.Caption & "&col=WW"
  335.     Case 9
  336.         S = "http://search.dejanews.com/nph-dnquery.xp?query=" & Escaped.Caption & "&defaultOp=AND&svcclass=dncurrent&maxhits=25"
  337.     Case 10
  338.         S = "http://204.161.74.8:1234/query/?query=" & Escaped.Caption & "&hits=25&disp=Text+Only"
  339.     Case 11
  340.         S = "http://search.go2net.com/crawler?general=" & Escaped.Caption & "&method=0&target=
  341. ion=0&rpp=20&timeout=5&hpe=10"
  342.     Case 12
  343.         S = "http://guaraldi.cs.colostate.edu:2000/search?KW=" & Escaped.Caption & "&classic=on&t1=x&Boolean=AND&Hits=10&Mode=MakePlan&df=normal&AutoStep=on&AutoInt=on&lb=1"
  344.     Case 13
  345.         S = "http://www.tucows.com/perl/tucowsSearch?word=" & Escaped.Caption & "&key=all&platform=win95"
  346.     Case 14
  347.         'CTNet not yet implemented
  348.     Case 15
  349.         S = "http://www.audiofind.com:70/?audiofindsize=0&audiofindsearch=" & Escaped.Caption
  350.     Case 16
  351.         S = "http://www.audiogalaxy.com/search.php3?MP3Name=" & Escaped.Caption
  352.     End Select
  353. 'Open the default Web Browser window with the selected
  354. 'location
  355.     ShellExecute Me.hwnd, "open", S, "", "", 1
  356. End Sub
  357. Private Sub cmdClose_Click()
  358. 'Close the program
  359.     End
  360. End Sub
  361. Private Sub mnuAbout_Click()
  362. 'Generate a standard About Message Box
  363.     MsgBox "Programmed by Pedro Lamas" & vbCrLf & "Copyright 
  364. 1997-1999 Underground Software" & vbCrLf & vbCrLf & "Home-Page (Dedicated to VB): www.terravista.pt/portosanto/3723/" & vbCrLf & "E-Mail: sniper@hotpop.com", vbApplicationModal + vbInformation, "Credits!"
  365. End Sub
  366. Private Sub mnuExit_Click()
  367. 'End the program
  368.     End
  369. End Sub
  370. Private Sub mnuSearch_Click()
  371. 'Start searching
  372.     cmdSearch_Click
  373. End Sub
  374. Private Sub Option1_Click(Index As Integer)
  375. 'Check if user selected a diferent Search Engine
  376.     If Selected <> Index Then
  377. 'Set the selected option button FontBold property to True
  378. 'and the old one to False
  379.         Option1(Selected).FontBold = False
  380.         Option1(Index).FontBold = True
  381. 'Update the selected engine variable
  382.         Selected = Index
  383.     End If
  384. End Sub
  385. Private Sub Text1_Change()
  386. 'Declare the required local variables
  387.     Dim I As Integer, Buffer As String, CBuffer As String
  388. 'Get the Text1 TextBox text
  389.     Buffer = Text1.Text
  390. 'Check if it is empty
  391.     If Buffer = "" Then
  392. 'If so, disable the Search CommandButton
  393.         cmdSearch.Enabled = False
  394.     Else
  395. 'If not, enable the Search CommandButton
  396.         cmdSearch.Enabled = True
  397.     End If
  398. 'Do for each letter of the Search String
  399.     For I = 1 To Len(Buffer)
  400. 'Check the letters ASCII value
  401.         Select Case Asc(Mid(Buffer, I, 1))
  402. 'Letters with no special encoding required, stay the same
  403.         Case 42, 43, 45 To 57, 64 To 90, 95, 97 To 122
  404.             CBuffer = CBuffer + Mid(Buffer, I, 1)
  405. 'Letters with special encoding required, are now coded
  406.         Case Else
  407.             CBuffer = CBuffer + "%" & Hex(Asc(Mid(Buffer, I, 1)))
  408.         End Select
  409.     Next I
  410. 'Show the encoded string on the Escaped Label
  411.     Escaped.Caption = CBuffer
  412. End Sub
  413.