Execute page_load event on the page
Execute the page_load event in the control.
Execute the callback event button_onclick event
Anyone who writes ASP programs knows that,Request. servervariables ("script_name ")Returns the relative path of the current page, for example,"Http: // localhost/BBS/post. asp", The returned result is"BBS/post. asp
Request. servervariables ("script_name ") This function is used to determine and output the path and name of the current execution file. When you change the name of an ASP file, the system automatically adapts to it to facilitate system migration. If you specify a submission page, the system will encounter an error once the file name changes. |
File IP Path: <% = "http: //" & request. servervariables ("SERVER_NAME") & request. servervariables ("script_name") %> <br/>
Local IP address: <% = request. servervariables ("remote_addr") %> <br/>
Server Name: <% = request. servervariables ("SERVER_NAME") %> <br/>
Server IP address: <% = request. servervariables ("local_addr") %> <br/>
Server port: <% = request. servervariables ("server_port") %> <br/>
Server time: <% = now %> <br/>
IIS Version: <% = request. servervariables ("server_software") %> <br/>
Script Timeout: <% = server. scripttimeout %> <br/>
Path of this file: <% = server. mappath (request. servervariables ("script_name") %> <br/>
Server CPU usage: <% = request. servervariables ("number_of_processors") %> <br/>
Server interpretation engine: <% = scriptengine & "/" & scriptenginemajorversion & "." & scriptengineminorversion & "." & scriptenginebuildversion %> <br/>
Server Operating System: <% = request. servervariables ("OS") %> <br/>
Supported file types: <% = request. servervariables ("http_accept") %> <br/>
Path of the accessed file: <% = request. servervariables ("http_url") %> <br/>
User Agent Information: <% = request. servervariables ("http_user_agent") %> <br/>
Get the file name in the URL and the passed value: request. servervariables ("script_name") + "? "+ Request. servervariables (" QUERY_STRING ") <br/>
Bytes -----------------------------------------------------------------------------------------------------
The result is as follows:
IP address of this file: http: // localhost/Ceshi. asp
Local IP Address: 127.0.0.1
Server Name: localhost
Server IP Address: 127.0.0.1
Server port 8091
Server time: 2005-7-27 14:28:04
Microsoft-IIS/5.0
Script Timeout: 90
Path: e:/hospital/Ceshi. asp
Server CPU count: 2
Server interpretation engine: VBScript/5.6.7426
Server Operating System: windows_nt
Supported file types: image/GIF, image/X-xbitmap, image/JPEG, image/pjpeg, application/vnd. MS-PowerPoint, application/vnd. MS-Excel, application/MSWord, application/X-Shockwave-flash ,*/*
Path of the accessed file:/Ceshi. asp
User Agent Information: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon; COM + 1.0.2204)
If you get the directory of this file, you can use the following functions:
<%
Public Function serverpath
Dim path
Dim POS
Path = "http: //" & request. servervariables ("SERVER_NAME") & request. servervariables ("script_name ")
Pos = Limit Rev (path ,"/")
Serverpath = left (path, POS)
End Function
%>
====================================< Br>
File directory: <% = serverpath %>
====================================< Br>
The running result is:
File directory: http: // localhost/=========================
Category: common environment variables | add to souzang | share to I post it | browse (597) | comment (0)
|
After logging on, you will be here. |
|
|
|