ASP获取服务器信息:IP 路径 时间等asp
<%
Public Function ServerPath
Dim Path
Dim Pos
Path="http://" & Request.ServerVariables("server_name") &Request.ServerVariables("script_name")
Pos=InStrRe...
<%
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
%>
本机ip:<%=request.servervariables("remote_addr")%> <br />
服务器名:<%=Request.ServerVariables("SERVER_NAME")%> <br />
服务器IP:<%=Request.ServerVariables("LOCAL_ADDR")%> <br />
服务器端口:<%=Request.ServerVariables("SERVER_PORT")%> <br />
服务器时间:<%=now%> <br />
year:<%=year(now)%> <br />
month:<%=month(now)%> <br />
day:<%=day(now)%> <br />
hour:<%=hour(now)%> <br />
minute:<%=minute(now)%> <br />
second:<%=second(now)%> <br />
date:<%=date%> <br />
time:<%=time%> <br />
IIS版本:<%=Request.ServerVariables("SERVER_SOFTWARE")%> <br />
脚本超时时间:<%=Server.ScriptTimeout%> <br />
本文件路径:<%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%> <br />
服务器CPU数量:<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%> <br />
服务器解译引擎:<%=ScriptEngine & "/"& ScriptEngineMajorVersion&"."&ScriptEngineMinorVersion&"."&ScriptEngineBuildVersion %> <br />
服务器操作系统:<%=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 />
服务器访问路径:http://<%=Request.ServerVariables("LOCAL_ADDR")%>:<%=Request.ServerVariables("SERVER_PORT")%><%=request.ServerVariables("script_name")%><br />
当前文档所在文件目录:<% =ServerPath %>
显示结果如下:
本机ip:10.75.193.3
服务器名:10.75.193.3
服务器IP:10.75.193.3
服务器端口:80
服务器时间:2011-6-22 10:48:07
year:2011
month:6
day:22
hour:10
minute:48
second:7
date:2011-6-22
time:10:48:07
IIS版本:NetBox Version 2.8 Build 4128
脚本超时时间:-1
本文件路径:C:\Program Files\小旋风AspWebServer\wwwroot\single\index.asp
服务器CPU数量:
服务器解译引擎:VBScript/5.7.18066
服务器操作系统:
支持的文件类型:*/*
访问的文件路径:
用户代理的信息:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; (R1 1.6); .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
获取url中的文件名和传过来的值:/single/index.asp?
服务器访问路径:http://10.75.193.3:80/single/index.asp
所在文件目录:http://10.75.193.3/single/
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
%>
本机ip:<%=request.servervariables("remote_addr")%> <br />
服务器名:<%=Request.ServerVariables("SERVER_NAME")%> <br />
服务器IP:<%=Request.ServerVariables("LOCAL_ADDR")%> <br />
服务器端口:<%=Request.ServerVariables("SERVER_PORT")%> <br />
服务器时间:<%=now%> <br />
year:<%=year(now)%> <br />
month:<%=month(now)%> <br />
day:<%=day(now)%> <br />
hour:<%=hour(now)%> <br />
minute:<%=minute(now)%> <br />
second:<%=second(now)%> <br />
date:<%=date%> <br />
time:<%=time%> <br />
IIS版本:<%=Request.ServerVariables("SERVER_SOFTWARE")%> <br />
脚本超时时间:<%=Server.ScriptTimeout%> <br />
本文件路径:<%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%> <br />
服务器CPU数量:<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%> <br />
服务器解译引擎:<%=ScriptEngine & "/"& ScriptEngineMajorVersion&"."&ScriptEngineMinorVersion&"."&ScriptEngineBuildVersion %> <br />
服务器操作系统:<%=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 />
服务器访问路径:http://<%=Request.ServerVariables("LOCAL_ADDR")%>:<%=Request.ServerVariables("SERVER_PORT")%><%=request.ServerVariables("script_name")%><br />
当前文档所在文件目录:<% =ServerPath %>
显示结果如下:
本机ip:10.75.193.3
服务器名:10.75.193.3
服务器IP:10.75.193.3
服务器端口:80
服务器时间:2011-6-22 10:48:07
year:2011
month:6
day:22
hour:10
minute:48
second:7
date:2011-6-22
time:10:48:07
IIS版本:NetBox Version 2.8 Build 4128
脚本超时时间:-1
本文件路径:C:\Program Files\小旋风AspWebServer\wwwroot\single\index.asp
服务器CPU数量:
服务器解译引擎:VBScript/5.7.18066
服务器操作系统:
支持的文件类型:*/*
访问的文件路径:
用户代理的信息:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; (R1 1.6); .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
获取url中的文件名和传过来的值:/single/index.asp?
服务器访问路径:http://10.75.193.3:80/single/index.asp
所在文件目录:http://10.75.193.3/single/
我要评论