asp获取当前路径语句大全
来源:互联网 发布:js对联广告 编辑:程序博客网 时间:2024/05/21 17:01
在asp开发中经常需要用到当前页面的路径,相对的,绝对的,有参数的,没有参数的,这里整理一下,个人感觉很全的asp获取页面路径语句大全,例如:request.servervariables script_name SERVER_SOFTWARE
文件ip路径:<%="http://" & request.servervariables("server_name")& request.servervariables("script_name") %> <br/>
本机ip:<%=request.servervariables("remote_addr")%> <br/>
服务器名:<%=Request.ServerVariables("SERVER_NAME")%><br/>
服务器IP:<%=Request.ServerVariables("LOCAL_ADDR")%><br/>
服务器端口:<%=Request.ServerVariables("SERVER_PORT")%><br/>
服务器时间:<%=now%><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/>
-----------------------------------------------------------------------------------------------------
产生的如下:
本文件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
服务器解译引擎:VBScript/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 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>
文件ip路径:<%="http://" & request.servervariables("server_name")& request.servervariables("script_name") %> <br/>
本机ip:<%=request.servervariables("remote_addr")%> <br/>
服务器名:<%=Request.ServerVariables("SERVER_NAME")%><br/>
服务器IP:<%=Request.ServerVariables("LOCAL_ADDR")%><br/>
服务器端口:<%=Request.ServerVariables("SERVER_PORT")%><br/>
服务器时间:<%=now%><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/>
-----------------------------------------------------------------------------------------------------
产生的如下:
本文件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
服务器解译引擎:VBScript/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 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>
0 0
- asp获取当前路径语句大全
- asp获取当前路径语句大全
- asp获取当前页面路径
- c#获取当前路径的方法大全
- ASP.Net 获取当前路径与C# 获取当前路径的不同
- 完整的获取当前jsp文件路径的语句
- 完整的获取当前jsp文件路径的语句
- ASP.net中DateTime获取当前系统时间的大全
- asp.net 中datetime获取当前系统时间的大全
- ASP.net中DateTime获取当前系统时间的大全
- asp获取当前文件在服务器上的全路径
- C#(ASP.Net)获取当前路径的方法集合
- C#、Asp.NET获取当前程序的路径
- C#(ASP.Net)获取当前路径的方法集合
- C#(ASP.Net)获取当前路径的方法集合
- C#(ASP.Net)获取当前路径的方法集合
- C#(ASP.Net)获取当前路径的方法集合
- C#(ASP.Net)获取当前路径的方法集合
- 设计模式(5)-对象创建型模式-Builder模式
- 使用strlcpy和strlcat
- 在win7下开启mysql服务
- Android Loaders(三)实现一个Base Loader
- POJ3130排序增量法
- asp获取当前路径语句大全
- nyoj 61 传纸条(一)双线程DP
- Asp.net课后生活(6)
- STM32F4 TIM1 7路PWM信号输出
- LeetCode: Linked List Cycle II
- Android中dip、dp、sp、pt和px的区别
- Asp.net课后总结(8)
- linux 下的select函数
- Python单元测试——深入理解unittest