To access properties and methods on the server, the ASP Server object is used
A D V E R T I S E M E N T
Server Object
To access properties and methods on the server, the ASP Server object is used. Its properties and methods are described below:
Properties
Property
Description
ScriptTimeout
Sets or returns the maximum number of seconds a script can run before it is terminated
Methods
Method
Description
CreateObject
Creates an instance of an object
Execute
Executes an ASP file from inside another ASP file
GetLastError()
Returns an ASPError object that describes the error condition that occurred/p>
HTMLEncode
Applies HTML encoding to a specified string
MapPath
Maps a specified path to a physical path
Transfer
Sends (transfers) all the information created in one ASP file to a second ASP file
URLEncode
Applies URL encoding rules to a specified string
Check when this file was last modified
html>
<body>
<%
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set rs = fs.GetFile(Server.MapPath("demo_lastmodified.asp"))
modified = rs.DateLastModified
%>
This file was last modified on: <%response.write(modified)
Set rs = Nothing
Set fs = Nothing
%>
</body>
</html>
O/P:
This file was last modified on: 9/12/2006 6:40:45 AM