WINDOWS 2000 Download ASP3.0 and IIS5.0

Source: Internet
Author: User
Tags error code iis modify versions client domain server
It is believed that most of the people currently using the ASP version are built in the IIS3.0 or IIS4.0 in the ASP2.0, server platform is also more NT4.0, with Windows 2000 will be in February 17, since the previous magazine media has been reported on Windows 2000 expansion of server performance and versions (server version, personal User version ...) , so we all can't wait to know what the powerful features are in Windows 2000, and we have to be aware of how Microsoft has improved in this area, as a user of NT servers. However, since this page is mainly about ASP applications, So the pen will be ASP3.0 and IIS5.0 in Windows 2000 with the ASP2.0 in the previous IIS3.0 or IIS4.0, and the added components or the expansion of the element and method to explain, overall, ASP20. and ASP3.0 not many different, More striking is the addition of two servo artifact methods (method)---SERVER. Execute and Server.Transfer and a newly added object--asperror object.

SERVER. Transfer method

Most of the past ASP2.0 control of the two Web pages is done by Response.Redirect, but the average person may not be able to say that Response.Redirect is clumsy in application, When ASP is Response.Redirect, a message is transferred to the client's browser. Inform the client that the browser is ready to load a new Web site, and the client browser receives this message and then returns a confirmation of the new Web message back to the server side, Then the server side will then lead the client browser to the new Web site, as the web unfolds today, this approach will have a greater shock to the congestion of the web, which is something that users and web managers are not happy to see, and instead of Response.Redirect this stupid way, ASP3.0 has added a new server approach--server.transfer, transferring all communication from the client and server side of the Response.Redirect to the server, all of which are handled by the server, of course!! There is no big difference between language and application and Response.Redirect, when you pass information to the Web and web, all of the time and application variables will stay the same, and look at the following, say:

Language method
SERVER. TRANSFER (PATH)

Path defines the web site of the destination that will be transferred from control to the Response.Redirect

The parameters are wonderful, for example,

Asp1.asp is as follows:

<HTML>
<BODY>
<%
Response.Write Session.SessionID

Response.Write ("<BR>")

Response.Write ("I want to go to the next Web page!!") <BR> ")

Server.Transfer ("asp2.asp")
%>

Asp2.asp is as follows
<HTML>
<BODY>
<%

Response.Write Session.SessionID
%>

Asp1.asp results are as follows

A SessionID
I want to go to the next Web page!!
Same SessionID.

Very obvious can see Response.Redirect and Server.Transfer difference!!

SERVER. Execute method

SERVER. Execute and Server.Transfer are all in the process of moving the script, the only difference is that the Server.Transfer will finally hand over the control to the script file being called, and Server.Execute the control right to the caller itself, which means that the script that performs the Server.Execute will be a part of the script that is being called, and, on the other hand, it is the same as the include approach, This is also the same thing with many high-level language calling programs, basically, the server allows Server.Execute to modify the HTTP title, but if the file that is executed modifies the HTTP title after sending the message to the client browser, the HTTP title is written to the user browser. Any changes to the HTTP title must be made before the page is written. Take a look at the following example:
ASP1
<HTML>
<BODY>
<% Response.Write ("Are you looking at me?") <BR> ")
Server.Execute ("asp2.asp")
%>
</BODY>
</HTML>
ASP2
<HTML>
<BODY>
<% Response.Write ("You can be a little closer.") ")%>
</BODY>
</HTML>
The results of the asp1.asp will be

Are you looking at me?
You can be a little bit closer.

After watching these two new additions to the servo artifacts, let's take a look at the new additions to the ASP's--asperror component, a brand new component provided by ASP3.0, which allows the site manager to fully control the bugs created by the ASP, which was not possible in the previous versions, It is not possible to capture the bugs that have been caused by the ASP in the previous releases, you can only use VBScript on Error Resume next to catch errors caused by the script, and any COM or ASP errors are not captured, and as ASP3.0 comes, These problems will be solved.

To use the ASPError object you must use IIS's HTTP error control, don't you realize that after we've been in our website, there's no discovery, when you make a few words in the www.pc-net.com.tw/Web site and then press ENTER, you'll notice that when the Web does not exist, the following screen appears:

This is called a custom error page, do you know how this is done? After you open the NT IIS server administrator, click the right mouse button above the platform name and select the content (the bottom option) you can see the following (the pen's Working platform is window 98) so you have to check the platform (The English version of NT is for everyone to explain).

You can see a lot of control options, choose Custom Errors in the upper-right corner, and then select the 404 error, and you'll see a path description in the Content section c:\winnt|help\common\404b.htm
This file is placed to describe the error message that occurs when the Web site that is being searched does not exist, and 404b.htm's original file is as follows:

404b.htm

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 3.2 final//en" >

<style>
a:link {font:9pt/12pt new details; color:red}
a:visited {font:9pt/12pt new body; color: #4e4e4e}
</style>
<meta http-equiv= "Content-type" content= "text-html; Charset=big5 ">
<title>http 404 Can't find </title>
<script>

function homepage () {
In real bits, URL get returned to We script like this:
Res://shdocvw.dll/http_404.htm#http://www.docurl.com/bar.htm

For testing Use Docurl = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
Docurl = Document.location.href;

This is where the HTTP or https'll is, as found by searching for://But skipping the res://
Protocolindex=docurl.indexof ("://", 4);

This finds the ending slash for the domain server
Serverindex=docurl.indexof ("/", Protocolindex + 3);

For the HREF, we are need a valid URL to the domain. We Search for the ' # symbol to find the beginning
The true URL, and add 1 to skip It-this is the Beginurl value. We use Serverindex as the end marker.
Urlresult=docurl.substring (Protocolindex-4,serverindex);
Beginurl=docurl.indexof ("#", 1) + 1;
if (Protocolindex-beginurl > 7)
Urlresult= ""

Urlresult=docurl.substring (Beginurl,serverindex);

For display, we need to skip http://, and go to the next slash
Displayresult=docurl.substring (Protocolindex + 3, serverindex);

Security Precaution:must filter Out "Urlresult" and "Displayresult"
Forbiddenchars = new RegExp ("[<>\ ' \"] "," G "); Global Search/replace
Urlresult = Urlresult.replace (Forbiddenchars, "");
Displayresult = Displayresult.replace (Forbiddenchars, "");

document.write (' <a target=_top href= ' + urlresult + ' "> ' + displayresult +" </a> ");

}

</script>

<body bgcolor= "White" >
<object id=saoc classid= ' clsid:b45ff030-4447-11d2-85de-00c04fa35c89 ' height=0 width=0></object>

<table width= "cellpadding=" 3 "cellspacing=" 5 ">
<tr>
&LT;TD id= "Tableprops" valign= "Top" align= "left" >Width= "height=" ></td>
&LT;TD id= "TABLEPROPS2" align= "left" valign= "Middle" width= "360" >

Style= "Color:black; font:12pt/15pt new Details "><span id=" ErrorText "><b> can't find a Web page </b></span></td>
</tr>
<tr>
&LT;TD id= "Tablepropswidth" width= "colspan=" "2" ><font
Style= "Color:black; FONT:9PT/12PT's new ">" Web page may have been removed, renamed or temporarily unused. </font></td>
</tr>
<tr>
&LT;TD id= "TablePropsWidth2" width= "colspan=" "2" ><font id= "LID1"
Style= "Color:black; font:9pt/12pt new Details "><p id= "LID2" > Please try the following:</p><ul>
<li id= "List1" > If you enter a Web site in a Web site, make sure that you have not misspelled any information. <br>
</li>
<li id= "List2" > Open <script> homepage (); </script> first, and then look up the link to the information you want to obtain.
</li>
<li id= "List3" > by <a href= "Javascript:history.back (1)" > [Previous] </a> button, move to other links. </li>
<li id= "List4" > Click <a href= "" > [Search] </a> to find Internet information. </li>
</ul>
<p><br>
</p>
&LT;H2 id= "Ietext" style= "font:9pt/12pt new details; Color:black ">http 404-No Files found <br>
Internet Explorer <BR>
</font></td>

</tr>
</table>
</body>

Before you normally use a custom error, you should see a picture that looks like this

The part of the net hyperlink to the Blue is 404b.htm through the homepage () function in the There are two ways to do this with the wrong page of your definition, the first of which is to simply save your own error page to C:\WINNT\help\common\ 404b.htm remember the file name to be the same, the second is to save the error page to the record you want to keep, and then directly modify the platform contents of the error in the errors in the selection of the path to store, as shown in the following diagram:

The http://www.yourserver.com/404.htm is to store the path based on the URL.

In IIS4.0 we can only capture 404 of the error messages, but IIS5.0 can use the ASP program to capture the server application 500 and 100 bugs (in the translation or the ASP program error) message, and after capturing the message to perform the ASP program you want to run, For example, the user is directed to a Web page in such a way that the user does not have to endure the wrong and unnecessary dilemma of browsing the Internet. Because users are mostly not aware of what is happening, if the user is informed by the site manager will make the user feel more.
How should ASPError objects be used? Basically he has to go with the new method of the server object GetLastError, because the ASPError object is passed through the Server.GetLastError method to transmit the error messages. For example, you set IIS5.0 to error.asp the user to the server after it has been caught in a 500 or 100 error message, and use error.asp to describe the error, let's see what error.asp is doing.
Error.asp

<%
Dim Objlastasperror

' Create a servo artifact (get the Last bug produced by ASP)

Set Objlastasperror = Server.GetLastError

' Describe the error situation
%>

The server encountered the following error:<br>
Description: <%=objLastASPError.Description%><BR>
Wrong types: <%=objLastASPError.Category%><BR>
A bug file: <%=objLastASPError.File%><BR>
Component error: <%=objLastASPError.Number%><BR>

Basically, ASPError objects are more than enough, and all of these are built of servo artifacts, and the GetLastError method in the servo widget is used to convey the error message, so let's see what else is in the ASPError object:
ASPCode: Passing back the error code generated by IIS

Number: Pass back the error code generated by COM objects

Source: The original program that produced the bug

CATEGORY: If it is a mistake in the ASP, it will be a COM or manuscript language error

FILE: Upload the wrong ASP file name

Line: Indicates which line of code is wrong and returns the number of rows

DESCRIPTION: A brief error message is returned

ASPDescription: Send back detailed error messages

Basically this is the difference between the ASP3.0 in IIS5.0 and the ASP2.0 in IIS4.0, and, of course, there are a lot of small places that have changed, just a little more unnoticed, so there's no writing, like IIS4.0 's preset value is false, If the user needs to open it again, but IIS5.0 for the lift performance directly to set the preset as true, strange, since the ability to lift performance why IIS4.0 to set him as false, call to ask Bill!! I don't know.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.