幾個常用Request.ServerVariables的中文

來源:互聯網
上載者:User

本檔案ip路徑:<%="http://" & request.servervariables("server_name")& request.servervariables("_name") %>

本機ip:<%=request.servervariables("remote_addr")%>

伺服器名:<%=Request.ServerVariables("SERVER_NAME")%>

伺服器IP:<%=Request.ServerVariables("LOCAL_ADDR")%>

伺服器連接埠:<%=Request.ServerVariables("SERVER_PORT")%>

伺服器時間:<%=now%>

IIS版本:<%=Request.ServerVariables("SERVER_SOFTWARE")%>

指令碼逾時時間:<%=Server.Timeout%>

本檔案路徑:<%=server.mappath(Request.ServerVariables("_NAME"))%>

伺服器CPU數量:<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%>

伺服器解譯引擎:<%=Engine & "/"& EngineMajorVersion &"."&EngineMinorVersion&"."& EngineBuildVersion %>

伺服器作業系統:<%=Request.ServerVariables("OS")%>

支援的檔案類型:<%=Request.ServerVariables("HTTP_Accept")%>

訪問的檔案路徑:<%=Request.ServerVariables("HTTP_url")%>

使用者代理程式的資訊:<%=Request.ServerVariables("HTTP_USER_AGENT")%>

擷取url中的檔案名稱和傳過來的值:request.ServerVariables("_name")+"?"+request.ServerVariableS("QUERY_STRING")

-----------------------------------------------------------------------------------------------------

產生的如下:

本檔案ip路徑:http://localhost/ceshi.asp

本機ip:127.0.0.1

伺服器名:localhost

伺服器IP:127.0.0.1

伺服器連接埠:8091

伺服器時間:2005-7-27 14:28:04

IIS版本:Microsoft-IIS/5.0

指令碼逾時時間:90

本檔案路徑:E:/hospital/ceshi.asp

伺服器CPU數量:2

伺服器解譯引擎:VB/5.6.7426

伺服器作業系統:Windows_NT

支援的檔案類型:image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*

訪問的檔案路徑:/ceshi.asp

使用者代理程式的資訊:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon; COM+ 1.0.2204)

如若獲得此檔案的目錄可以利用下面的函數:

<%

Public ServerPath

Dim Path

Dim Pos

Path="http://" & Request.ServerVariables("server_name") & Request.ServerVariables("_name")

Pos=InStrRev(Path,"/")

ServerPath=Left(Path,Pos)

End

%>

=====================

所在檔案目錄:<%=ServerPath%>

=====================

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.