javascript asp教程第八课--request对象(3)

The Request Shortcut:

Request.Form() and Request.QueryString() share a shortcut. Request.Form("WebPageVariable") can be abbreviated as Request("WebPageVariable") and Request.QueryString("QueryVariable") can be abbreviated as Request("QueryVariable").

ServerVariables:

Server Variables represent the HTTP Headers sent to the server by the client. I won't demonstrate them all, because there are too many.

<%@LANGUAGE="JavaScript"%>
<HTML>
<TABLE BORDER="1">
<TR><TD>ALL_RAW</TD>
<TD><%=Request.ServerVariables("ALL_RAW")%></TD></TR>
<TR><TD>REMOTE_ADDR</TD>
<TD><%=Request.ServerVariables("REMOTE_ADDR")%></TD></TR>
<TR><TD>HTTP_USER_AGENT</TD>
<TD><%=Request.ServerVariables("HTTP_USER_AGENT")%></TD></TR>
<TR><TD>URL</TD>
<TD><%=Request.ServerVariables("URL")%></TD></TR>
</TABLE>
</HTML>

Click Here to run the script in a new window.

Demonstrated above are four (4) server variables. There are (give or take) about 50 server variables available. You can look up the full list of server variables for yourself on the internet.

Misc. Notes:

Request.BinaryRead() is the lone method and TotalBytes is the lone property. Request.BinaryRead(Request.TotalBytes) retrieves data from an HTML form using "POST." You must supply the TotalBytes as an argument. It stores the data into an array. BinaryRead cannot be used at the same time as Request.Form().

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3208.html