当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP ServerVariables 集合

ASP
ASP 介绍
ASP Install
ASP 语法
ASP 变量
ASP Procedures
ASP Forms
ASP Cookies
ASP Session
ASP Application
ASP #include
ASP Global.asa
ASP Send e-mail
ASP Response
ASP Request
ASP Application
ASP Session
ASP Server
ASP Error
ASP FileSystem
ASP TextStream

ASP ServerVariables 集合


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 388 ::
收藏到网摘: n/a

The ServerVariables collection is used to retrieve the server variable values.
ServerVariables集合的作用是获取服务器变量的值。

Syntax
语法

Request.ServerVariables (server_variable)

Parameter
参数
Description
描述
server_variable Required. The name of the server variable to retrieve
必要参数。获取服务器变量的名称

Server Variables

Variable
变量
Description
描述
ALL_HTTP Returns all HTTP headers sent by the client. Always prefixed with HTTP_ and capitalized
客户端发送的所有 HTTP 标题文件
ALL_RAW Returns all headers in raw form
返回所有raw form中的标题
APPL_MD_PATH Returns the meta base path for the application for the ISAPI DLL
返回ISAPI DLL的请求meta基础路径
APPL_PHYSICAL_PATH Returns the physical path corresponding to the meta base path
返回与meta基础路径相关的物理路径
AUTH_PASSWORD Returns the value entered in the client's authentication dialog
返回认证用户会话的值
AUTH_TYPE The authentication method that the server uses to validate users
服务器用来鉴定有效用户的方法。
AUTH_USER Returns the raw authenticated user name
返回认证用户的名称
CERT_COOKIE Returns the unique ID for client certificate as a string
以字符串形式返回认证客的独立ID
CERT_FLAGS bit0 is set to 1 if the client certificate is present and bit1 is set to 1 if the cCertification authority of the client certificate is not valid
如果该认证客户存在,那么则将数位0设置成1;如果认证客户不存在,则将数位1设置成1。
CERT_ISSUER Returns the issuer field of the client certificate
用户验证中的颁布者字段(O=MS,OU=IAS,CN=user name,C=USA)
CERT_KEYSIZE Returns the number of bits in Secure Sockets Layer connection key size
安全套接字层连接关键字的位数,如 128。
CERT_SECRETKEYSIZE Returns the number of bits in server certificate private key
服务器验证私人关键字的位数。如 1024
CERT_SERIALNUMBER Returns the serial number field of the client certificate
用户验证的序列号字段
CERT_SERVER_ISSUER Returns the issuer field of the server certificate
服务器验证的颁发者字段
CERT_SERVER_SUBJECT Returns the subject field of the server certificate
服务器验证的主字段
CERT_SUBJECT Returns the subject field of the client certificate
客户端验证的主字段
CONTENT_LENGTH Returns the length of the content as sent by the client
客户端发出内容的长度
CONTENT_TYPE Returns the data type of the content
内容的数据类型。同附加信息的查询一起使用,如 HTTP 查询 GET、 POST 和 PUT
GATEWAY_INTERFACE Returns the revision of the CGI specification used by the server
服务器使用的 CGI 规格的修订。格式为 CGI/revision
HTTP_<HeaderName> Returns the value stored in the header HeaderName
HeaderName存储在标题文件中的值。未列入该表的标题文件必须以 HTTP_ 作为前缀,以使 ServerVariables 集合检索其值。注意 服务器将 HeaderName 中的下划线(_)解释为实际标题中的破折号。例如,如果您指定 HTTP_MY_HEADER,服务器将搜索以 MY-HEADER 为名发送的标题文件。
HTTP_ACCEPT Returns the value of the Accept header
返回允许的header[标头]值
HTTP_ACCEPT_LANGUAGE

Returns a string describing the language to use for displaying content
返回字符串,该字符串是用于描述一个用于显示内容语言

HTTP_COOKIE Returns the cookie string included with the request
返回一个包含请求指令的cookie字符串
HTTP_REFERER

Returns a string containing the URL of the page that referred the request to the current page using an <a> tag. If the page is redirected, HTTP_REFERER is empty
返回一个页面URL的字符串,该页面使用了<a>标签向当前页提交了请求。如果页面被重定向,那么HTTP_REFERER值为空

HTTP_USER_AGENT

Returns a string describing the browser that sent the request
返回一个字符串,用于描述发送请求的浏览器

HTTPS Returns ON if the request came in through secure channel or OFF if the request came in through a non-secure channel
如果请求穿过安全通道(SSL),则返回 ON。如果请求来自非安全通道,则返回 OFF
HTTPS_KEYSIZE Returns the number of bits in Secure Sockets Layer connection key size
安全套接字层连接关键字的位数,如 128
HTTPS_SECRETKEYSIZE Returns the number of bits in server certificate private key
服务器验证私人关键字的位数。如 1024
HTTPS_SERVER_ISSUER Returns the issuer field of the server certificate
服务器验证的颁发者字段
HTTPS_SERVER_SUBJECT Returns the subject field of the server certificate
服务器验证的主字段
INSTANCE_ID The ID for the IIS instance in text format
文本格式 IIS 实例的 ID。如果实例 ID 为 1,则以字符形式出现。使用该变量可以检索请求所属的(元数据库中)Web 服务器实例的 ID
INSTANCE_META_PATH The meta base path for the instance of IIS that responds to the request
响应请求的 IIS 实例的元数据库路径
LOCAL_ADDR Returns the server address on which the request came in
返回接受请求的服务器地址。如果在绑定多个 IP 地址的多宿主机器上查找请求所使用的地址时,这条变量非常重要
LOGON_USER Returns the Windows account that the user is logged into
用户登录 Windows NT® 的帐号
PATH_INFO Returns extra path information as given by the client
客户端提供的额外路径信息。可以使用这些虚拟路径和 PATH_INFO 服务器变量访问脚本。如果该信息来自 URL,在到达 CGI 脚本前就已经由服务器解码了
PATH_TRANSLATED A translated version of PATH_INFO that takes the path and performs any necessary virtual-to-physical mapping
转换后的版本,该变量获取路径并进行必要的由虚拟至物理的映射。
QUERY_STRING Returns the query information stored in the string following the question mark (?) in the HTTP request
查询 HTTP 请求中问号(?)后的信息
REMOTE_ADDR Returns the IP address of the remote host making the request
发出请求的远程主机的 IP 地址
REMOTE_HOST Returns the name of the host making the request
发出请求的主机名称。如果服务器无此信息,它将设置为空的 MOTE_ADDR 变量
REMOTE_USER Returns an unmapped user-name string sent in by the user
用户发送的未映射的用户名字符串。该名称是用户实际发送的名称,与服务器上验证过滤器修改过后的名称相对
REQUEST_METHOD Returns the method used to make the request
该方法用于提出请求。相当于用于 HTTP 的 GET、HEAD、POST 等等
SCRIPT_NAME Returns a virtual path to the script being executed
执行脚本的虚拟路径。用于自引用的 URL
SERVER_NAME Returns the server's host name, DNS alias, or IP address as it would appear in self-referencing URLs
出现在自引用 UAL 中的服务器主机名、DNS 化名或 IP 地址
SERVER_PORT Returns the port number to which the request was sent
发送请求的端口号
SERVER_PORT_SECURE Returns a string that contains 0 or 1. If the request is being handled on the secure port, it will be 1. Otherwise, it will be 0
包含 0 或 1 的字符串。如果安全端口处理了请求,则为 1,否则为 0
SERVER_PROTOCOL Returns the name and revision of the request information protocol
请求信息协议的名称和修订。格式为 protocol/revision
SERVER_SOFTWARE Returns the name and version of the server software that answers the request and runs the gateway
应答请求并运行网关的服务器软件的名称和版本。格式为 name/version
URL Returns the base portion of the URL
提供 URL 的基本部分

Examples
举例

Example 1

You can loop through all of the server variables like this:

<%
for each x in Request.ServerVariables response.write(x & "<br />")
next %>

Example 2

This example demonstrates how to find out the visitor's browser type, IP address, and more:

<html>
<body>
<p>
<b>You are browsing this site with:</b>
<%Response.Write(Request.ServerVariables("http_user_agent"))%>
</p>
<p>
<b>Your IP address is:</b>
<%Response.Write(Request.ServerVariables("remote_addr"))%>
</p>
<p>
<b>The DNS lookup of the IP address is:</b>
<%Response.Write(Request.ServerVariables("remote_host"))%>
</p>
<p>
<b>The method used to call the page:</b>
<%Response.Write(Request.ServerVariables("request_method"))%>
</p>
<p>
<b>The server's domain name:</b>
<%Response.Write(Request.ServerVariables("server_name"))%>
</p>
<p>
<b>The server's port:</b>
<%Response.Write(Request.ServerVariables("server_port"))%>
</p>
<p>
<b>The server's software:</b>
<%Response.Write(Request.ServerVariables("server_software"))%>
</p>
</body>
</html>

评论 (0) All

登陆 | 还没注册?