Microsoft's ASP (Active Server Page) technology greatly facilitates access to the database on the network, and because the ASP is different from the CGI need
Multiple requests (reducing the server's resource footprint) and ASP's combination with Windows NT, 2000 makes ASP technology widely used in today's
Internet, but do not know that you have carefully thought about it! In addition to leveraging ADO access to the database and the use of several other built-in components, ASP cannot make other
What, compared to perl,php and other programs, the function of ASP looks very simple, and lack of functionality; but old than after all is old than, he gave everybody to save a
Hand, that is the ASP component (on the concept of components, now a lot, you can not be mistaken), through the development of components you can do other languages (such as
php,perl,c++) can do everything, even in some ways more than, this article seeks to show you the ASP components of the powerful features, but because of ASP
Component itself (using a non-registration component), may sometimes be used in a state of instability, but this article is trying to show you something and
Provide a way of thinking to you, not the other, so the lack of place on the request of forgiveness!
Code idea: Generally speaking, we submit a form to a search engine program, the search engine gets the submitted data then processed, returns the result;
Things are actually getting a submitted variable, we can use another way to access the search engine directly with the connection, for example, you can use the Yeah
First search for a keyword "Xuankong", you can also use the following connection "http://search.163.com/cgi-
Bin/search/engine/search.fcgi?key=xuankong "Get use results, this article is to access this direct connection by using ASP's HTTP component
Then, use the Get method to obtain the data that was originally returned in the Web page, and then output.
If this component is capable of multithreading (if that is the case, you can get data to different engines at the same time, you don't have to have a single access now and then get the results,) and generation
Code to further optimize and improve the words, will greatly save your time, let you search at the same time to return multiple engine results!
Note: The results of the search out, because some of the engine's class uses a relative connection, so invalid (these results you can actually handle, but the author is too
Lazy, so do not want to spend those efforts), but all the Web site and the Web connection is valid, the code provided in this article is only suitable for testing, not suitable for specific
Applications, if you need specific applications, you need to use the appropriate HTTP components, or if you are a master of the program can write their own multithreaded components, about
HTTP component code, you can see in www.chinaasp.com, want to get more ASP components please visit www.aspcn.com!
Code Start:
<!--
Have any comments and suggestions please mail:pu.junjie@263.net,
This code uses the HTTP component to search out several search engine data at the same time, so that all the search results are displayed in a page, this article just provides a kind of thinking
Road and thinking
To show you the powerful features of ASP components!
Because this component is not a registered component may have limited functionality, but also because the search for several engines simultaneously (search engine can expand arbitrarily, but will affect the speed
), so the system has been outputting data for a long time, please wait patiently
Before using this code, please go to download http://www.serverobjects.com/comp/asphttp3.zip, and then extract to your system32 directory.
(Winnt or Win2000)
Register this component with Regsvr32 asphttp.dll, and then copy this file to the relevant IIS executable directory, using IE or Netscape to browse
-->
<%
' Determines whether the output page or process the data, thus calling the different parts
Keyword=trim (request.form ("keyword"))
If IsNull (keyword) or keyword= "" Then
%>
<!--
HTML page Code display
-->
<title>aspcn.com Super Search engine </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "Author" content= "Ba Junjie" >
<meta name= "Keywords" content= "ASP, Components, www.aspcn.com" >
<style type= "Text/css" >
<!--
Table {font-size:9pt; Font-style:normal}
. Test {border:1px #000000 dashed; Border-color: #000000 None}
. test1 {background-color: #CCFFCC; Clip:rect (); font-size:9pt; Font-style:
Normal border-style:dashed; border-top-width:1px; border-right-width:1px; Border-bottom-width:
1px; BORDER-LEFT-WIDTH:1PX}
-->
</style>
<body bgcolor= "#FFFFFF" leftmargin= "0" topmargin= "0" marginwidth= "0" marginheight= "0" >
<table width= "75%" border= "1" align= "center" height= "" cellpadding= "0" cellspacing= "1"
Bgcolor= "#66CC99" bordercolor= "#FFFFFF" >
<tr>
<TD height= "4" >
<div align= "center" ><font color= "#000000" size= "2" face= "Arial" >aspcn.com</font><font
Color= "#000000" size= "3" face= "Arial" ></font><b><font color= "#000000" size= "3" face= "Arial" >
</font><font color= "#000000" size= "3" face= "Imitation _gb2312" > Super Search Engine </font></b></div>
</td>
</tr>
<tr bordercolor= "#66CC99" >
<TD height= > Please select the following search engine: (Please note: This search engine is only suitable for <font color= "#ffffff" > Web Search
</font>) </td>
</tr>
<tr bordercolor= "#FFFFFF" align= "center" valign= "Top" >
<TD height= ">"
<form method= "POST" action= "http.asp" >
<table width= "96%" border= "0" height= "align=" "Center" >
<tr>
<TD height= "Ten" width= "31%" >
<div align= "Right" > Please enter the keyword you want to search: </div>
</td>
<TD height= "Ten" width= "69%" >
<input type= "text" name= "keyword" class= "Test" >
</td>