文件ip路徑:<%="http://" & request.servervariables("server_name")& request.servervariables("script_name") %> <br/>
本機(jī)ip:<%=request.servervariables("remote_addr")%> <br/>
服務(wù)器名:<%=Request.ServerVariables("SERVER_NAME")%><br/>
服務(wù)器IP:<%=Request.ServerVariables("LOCAL_ADDR")%><br/>
服務(wù)器端口:<%=Request.ServerVariables("SERVER_PORT")%><br/>
服務(wù)器時(shí)間:<%=now%><br/>
IIS版本:<%=Request.ServerVariables("SERVER_SOFTWARE")%><br/>
腳本超時(shí)時(shí)間:<%=Server.ScriptTimeout%><br/>
本文件路徑:<%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%><br/>
服務(wù)器CPU數(shù)量:<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%><br/>
服務(wù)器解譯引擎:<%=ScriptEngine & "/"& ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."&ScriptEngineBuildVersion %><br/>
服務(wù)器操作系統(tǒng):<%=Request.ServerVariables("OS")%> <br/>
支持的文件類型:<%=Request.ServerVariables("HTTP_Accept")%> <br/>
訪問的文件路徑:<%=Request.ServerVariables("HTTP_url")%> <br/>
用戶代理的信息:<%=Request.ServerVariables("HTTP_USER_AGENT")%> <br/>
獲取url中的文件名和傳過來的值:request.ServerVariables("script_name")+"?"+request.ServerVariableS("QUERY_STRING") <br/>
-----------------------------------------------------------------------------------------------------
產(chǎn)生的如下:
本文件ip路徑:http://localhost/ceshi.asp
本機(jī)ip:127.0.0.1
服務(wù)器名:localhost
服務(wù)器IP:127.0.0.1
服務(wù)器端口:8091
服務(wù)器時(shí)間:2005-7-27 14:28:04
IIS版本:Microsoft-IIS/5.0
腳本超時(shí)時(shí)間:90
本文件路徑:E:\hospital\ceshi.asp
服務(wù)器CPU數(shù)量:2
服務(wù)器解譯引擎:VBScript/5.6.7426
服務(wù)器操作系統(tǒng):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)
如若獲得此文件的目錄可以利用下面的函數(shù):
<%
Public Function ServerPath
Dim Path
Dim Pos
Path="http://" & Request.ServerVariables("server_name") & Request.ServerVariables("script_name")
Pos=InStrRev(Path,"/")
ServerPath=Left(Path,Pos)
End Function
%>
=====================<br>
所在文件目錄:<%=ServerPath%>
=====================<br>
運(yùn)行結(jié)果為:
所在文件目錄:http://localhost/ =====================
--------------------
原文地址:https://website.pbottle.com/a-580.html