Skip Navigation Links

WebIndexer

Description

WebIndexer creates a searchable index of the World Wide Web starting at the URL that you specify.

This source code was published as part of an article that originally appeared in ActiveWeb Developer. Copyright Pinnacle Publishing Inc. All rights reserved.

WebIndexer

Running WebIndexer

Launch WebIndexer. Enter a URL in the URL textbox and specify the number of hops. Choosing zero hops means that only the starting URL will be indexed, while choosing one hop means that the URLs that the starting URL hyperlinks to will be also be indexed. Since Web pages tend to contain a large number of hyperlinks, keep the number of hops low, or the indexing process will take too long. Specify a timeout and press the Creat Index button.

Since the index is built in a separate thread, you can search for words while it's being built. Type one or more words in the Search For textbox and select the And radio button to find pages with all the words, or select the Or radio button for pages containing at least one. The search is fast enough that it's repeated every time a character changes in the Search For textbox. Click an underlined search hit to display the page in the embedded Web browser.

The C# and .NET concepts illustrated by this source code include:

  1. Using the WebRequest class to download web pages
  2. Extracting hyperlinks from Web pages using regular expressions
  3. Threads

Requirements

This source code was developed with Microsoft Visual Studio 2005. Fractal Viewer requires .Net 2.0.

Source Code



Home Page   Vault 3   Shareware   C# .NET Tips   Download C# .NET Source Code   Browse C# .NET Source Code   C# .NET Open Source   On-Line Utilities   Blog   Contact