%startime=timer()%> a href=#bot>到下面看執(zhí)行的時間/a> % for i= 1 to 5000 response.write("hr width="int(500+i)">") next %> 當然中間還可以添加其它內(nèi)容。br> %endtime=timer()%> a name=bot>/a> %=FormatNumber((endtime-startime)*1000,3)%>毫秒 |
%Server.ScriptTimeout=110%> |
%Response.write ("這是沒有采用 HTMLEncode 方法的測試。br> 這里就另起一行,說明代碼被執(zhí)行。nbsp;")%> hr> %Response.write Server.HtmlEncode("這是對 HTMLEncode 方法的測試。br> 這里應該不會另起一行,也就是代碼沒有被執(zhí)行了。nbsp;")%> |
%filepath=request.servervariables("script_name")%> 接受URL中的值(沒有處理接受值,發(fā)現(xiàn)值被解釋了): %=request.querystring("cnbruce")%> form action="%=filepath%>"> 你可以輸入“l(fā)t;hrgt”等代碼看看:input type="text" size="20" name="cnbruce">input type="submit"> /form> 接受URL中的值(進行了urlencode編碼,不會執(zhí)行): %=Server.URLEncode(request.querystring("cnbruce"))%> |
% function tihuan(what) tihuan=what if not isnull(what) then tihuan=replace(tihuan,"%3C","lt;") tihuan=replace(tihuan,"%3D","=") tihuan=replace(tihuan,"%3E","gt;") tihuan=replace(tihuan,"%26","") tihuan=replace(tihuan,"%20","nbsp;") tihuan=replace(tihuan,"%3B","#59;") tihuan=replace(tihuan,"%22","quot;") tihuan=replace(tihuan,"%2B","+") tihuan=replace(tihuan,"%2F","/") end if end function %> %filepath=request.servervariables("script_name")%> 接受URL中的值(沒有處理接受值,發(fā)現(xiàn)值被解釋了): %=request.querystring("cnbruce")%> form action="%=filepath%>"> 你可以輸入“l(fā)t;hrgt”等代碼看看:input type="text" size="20" name="cnbruce">input type="submit"> /form> 接受URL中的值(進行了urlencode編碼,不會執(zhí)行): %=tihuan(Server.URLEncode(request.querystring("cnbruce")))%> |
Server.MapPath(Path) |
Request.ServerVariables("APPL_PHYSICAL_PATH") : %=Request.ServerVariables("APPL_PHYSICAL_PATH")%>p> Request.ServerVariables("PATH_INFO") : %=Request.ServerVariables("PATH_INFO")%>p> Request.ServerVariables("SCRIPT_NAME") : %=Request.ServerVariables("SCRIPT_NAME")%>p> Request.ServerVariables("URL") : %=Request.ServerVariables("URL")%>p> Request.ServerVariables("PATH_TRANSLATED") : %=Request.ServerVariables("PATH_TRANSLATED")%>hr> 上面都是通過ServerVariables提取得出的值,下面就來運用mapath把一個虛擬地址轉(zhuǎn)變?yōu)閷嶋H的物理地址。p> Server.MapPath(Request.ServerVariables("URL")) :%=Server.MapPath(Request.ServerVariables("URL"))%>p> 或者自己隨便寫個不存在的路徑,同樣能夠執(zhí)行p> Server.MapPath("cnbruce.asp") : %=Server.MapPath("cnbruce.asp")%>p> 再來個“/”的p> Server.MapPath("/cnbruce.asp") : %=Server.MapPath("/cnbruce.asp")%>br> Server.MapPath("\cnbruce.asp") : %=Server.MapPath("\cnbruce.asp")%>p> 你會發(fā)現(xiàn)物理地址轉(zhuǎn)變到IIS默認根目錄下面了。 這就是如6to23之類的站點mappath的問題所在。還是虛擬主機好,即使是根,也還是自己站點的默認存放節(jié)點根。 |