本檔案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%>
=====================