ASP.NETʹÓÃRequest»ñÈ¡À´Ô´ÍøÖ·URL²ÎÊý
Request¶ÔÏó¹¦ÄÜÊÇ´Ó¿Í»§¶ËµÃµ½Êý¾Ý£¬³£ÓõÄÈýÖÖÈ¡µÃÊý¾ÝµÄ·½·¨ÊÇ£ºRequest.Form¡¢Request.QueryString£¬Request¡£ÆäµÚÈýÖÖÊÇÇ°Á½ÖÖµÄÒ»¸öËõд£¬¿ÉÒÔÈ¡´úÇ°Á½ÖÖÇé¿ö¡£¶øÇ°Á½ÖÖÖ÷Òª¶ÔÓ¦µÄFormÌύʱµÄÁ½ÖÖ²»Í¬µÄÌá½»·½·¨£º·Ö±ðÊÇPost·½·¨ºÍGet·½·¨¡£
Request ¶ÔÏóµÄÊôÐԺͷ½·¨±È½Ï¶à£¬³£Óõļ¸¸öΪ£ºUserAgent ´«»Ø¿Í»§¶Ëä¯ÀÀÆ÷µÄ°æ±¾ÐÅÏ¢£¬UserHostAddress ´«»ØÔ¶·½¿Í»§¶Ë»úÆ÷µÄÖ÷»úIP µØÖ·£¬UserHostName ´«»ØÔ¶·½¿Í»§¶Ë»úÆ÷µÄDNS Ãû³Æ£¬PhysicalApplicationPath ´«»ØÄ¿Ç°ÇëÇóÍøÒ³ÔÚServer ¶ËµÄÕæʵ·¾¶¡£
´Óä¯ÀÀÆ÷»ñÈ¡Êý¾Ý
ÀûÓÃRequest·½·¨£¬¿ÉÒÔ¶ÁÈ¡ÆäËûÒ³ÃæÌá½»¹ýÀ´µÄÊý¾Ý¡£Ìá½»µÄÊý¾ÝÓÐÁ½ÖÖÐÎʽ£ºÒ»ÖÖÊÇͨ¹ýForm±íµ¥Ìá½»¹ýÀ´£¬ÁíÒ»ÖÖÊÇͨ¹ý³¬¼¶Á´½ÓºóÃæµÄ²ÎÊýÌá½»¹ýÀ´£¬Á½ÖÖ·½Ê½¶¼¿ÉÒÔÀûÓÃRequest¶ÔÏó¶ÁÈ¡¡£
<%@ Page Language="C#"%>
<%
string strUserName = Request["Name"];
string strUserLove = Request["Love"];
%>
ÐÕÃû£º<%=strUserName%>
°®ºÃ£º<%=strUserLove%>
<form action="" method="post">
<P>ÐÕÃû£º<input type="TEXT" size="20" name="Name"></P>
<P>ÐËȤ£º<input type="TEXT" size="20" name="Love"></P>
<P><input type="submit" value="Ìá ½»"></P>
</form>
µÃµ½¿Í»§¶ËµÄÐÅÏ¢
ÀûÓÃRequest¶ÔÏóÄÚÖõÄÊôÐÔ£¬¿ÉÒԵõ½Ò»Ð©¿Í»§¶ËµÄÐÅÏ¢£¬±ÈÈç¿Í»§¶Ëä¯ÀÀÆ÷°æ±¾ºÍ¿Í»§¶ËµØÖ·µÈµÈ
<%@ Page Language="C#"%>
¿Í»§¶Ëä¯ÀÀÆ÷£º<%=Request.UserAgent %>
¿Í»§¶ËIPµØÖ·£º<%=Request.UserHostAddress %>
µ±Ç°Îļþ·þÎñ¶ËÎïÀí·¾¶£º<%=Request.PhysicalApplicationPath %>
Request ¶ÔÏóµÄÊôÐÔ
¡¡¡¡UserLanguages ¿Í»§¶ËÖ÷»úËùʹÓõÄÓïÑÔ
¡¡¡¡UserHostName ¿Í»§¶ËÖ÷»úµÄDNSÃû³Æ
¡¡¡¡userHostArrress ¿Í»§¶ËÖ÷»úµÄIPµØÖ·
¡¡¡¡UserAgent ¿Í»§¶Ëä¯ÀÀÆ÷°æ±¾
¡¡¡¡Url µ±Ç°ÒªÇóµÄURL
¡¡¡¡TotalBytes µ±Ç°ÊäÈëµÄÈÝÁ¿´óС
¡¡¡¡ServerVariables ÍøÒ³µÄServer±äÁ¿
¡¡¡¡RequestType ¿Í»§¶ËÍøÒ³µÄ´«ËÍ·½Ê½(Get/Post)
¡¡¡¡RawUrl µ±Ç°Ò³ÃæµÄU¡ºRL
¡¡¡¡QueryString ä¯ÀÀÆ÷µØÖ·À¸ºóµÄ²ÎÊý
¡¡¡¡PhysicalPath µ±Ç°ÍøÒ³ÔÚ
Ïà¹ØÎĵµ£º
ÔÚC#ÖÐ
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
using System.Collections.Generic;
using System.Collections;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.Ba ......
Ê×ÏÈÃèÊöÒ»ÏÂÎÊÌâ:ÒòΪ¿Í»§µÄÐèÒª,°ÑËùÓжÔÓÚÊý¾Ý¿âµÄ²Ù×÷×ö³ÉÁË´æ´¢¹ý³Ì,ͬʱҲ´æÔÚ´øÓÐÊäÈë²ÎÊýµÄ´æ´¢¹ý³Ì.¿Í»§ÒªÇó½«ËùÓеÄÐÅÏ¢¶¼¿ÉÒÔÓÃË®¾§±¨±íÏÔʾ.ÎÒÃǶ¼ÖªµÀ,ҪʹÓÃË®¾§±¨±íÎÒÃǾÍҪʹÓÃÊý¾ÝÔ´µÄ.ÔÚÕâÀï,ÎÒÃÇʹÓõÄÊý¾ÝÔ´×ÔÈ»¶øȻҲ¾ÍÊÇ´æ´¢¹ý³ÌÁË.µ±È»,ÎÒÃÇÒ²ÊÇÖªµÀµÄ,ÔÚADO.NETµÄÁ ......
1. ×¢²ájsº¯Êý
String scriptString = "<script language=JavaScript>function doClick(){";
scriptString += "for(var index=0;index<myArray.length;index++)";
scriptString += "alert(myArray[index]);}<";
scriptString += "/" + "script>";
ClientScript.RegisterStartupScript(typeof(WebForm2) ......
@import url(¡°layout.css¡±)
CSS Selectors: *, p, div span, div > span, *[href], li+li, .title, #container, #title p:first-child, a:link, a:hover, a:visited, p:before, p:after
p:after{content:¡¯url(images/quote.gif)¡¯}
!important State Mode: Off, InProc, StateServer, SQLServer, C ......
Èç¹û²âÊÔµÄurlµØÖ·ÊÇhttp : //www.test.com/testweb/default.aspx, ½á¹ûÈçÏ£º
Request.ApplicationPath: /testweb
Request.CurrentExecutionFilePath: /testweb/default.aspx
Request.FilePath: /testweb/default.aspx
Request.Path: /testweb/default.aspx
Request.PhysicalApplicationPath: E:\WWW\testwebReq ......