Example of using the Server Object
View the source code

Using Server.CreateObject :

ERROR!
Creating the Unknown object gave the following error : 006~ASP 0177~Server.CreateObject Failed~800401f3
Error number = -2147221005, Error source = Server object

Transaction processing is not currently supported

Server Execute is not currently supported :

Server.GetLastError is not currently supported :

Using Server.HTMLEncode :
Here is some bold text
Here is some <B>bold text</B>

Using Server.MapPath :
D:\inetpub\phdcc\dynamic-cd\dcddoc\bioDoc\servTst.asp

Because the path parameters in the following examples do not start with a slash character, they are mapped relative to the current directory :
D:\inetpub\phdcc\dynamic-cd\dcddoc\bioDoc\data.txt
D:\inetpub\phdcc\dynamic-cd\dcddoc\bioDoc\script\data.txt

The next two examples use the slash characters to specify that the path returned should be looked up as complete virtual paths on the server :
D:\inetpub\phdcc\script\data.txt
D:\inetpub\phdcc\script

The following examples demonstrate how you can use either a forward slash (/) or a backslash (\) to return the physical path to the home directory of the Web site root :
D:\inetpub\phdcc
D:\inetpub\phdcc

The following examples demonstrate how you can use relative pathing to return the relative physical path to the page that is being viewed in the web browser :
D:\inetpub\phdcc\dynamic-cd\dcddoc
D:\inetpub\phdcc\dynamic-cd\dcddoc

The Server.Transfer method currently is equivalent to Response.Redirect and so in the following script, the output text "I am going to ASP2" would be lost :
I am going to ASP2

Using Server.URLEncode :
http%3A%2F%2Fwww%2Ephdcc%2Ecom