function getRealPath(){ //获取当前网址,如: http://localhost:8083/myproj/view/my.jsp var curWwwPath=window.document.location.href; //获取主机地址之后的目录,如: myproj/view/my.jsp var pathName=window.document.location.pathname; var pos=curWwwPa…
非Web程序获取路径几种方法如下: 1.AppDomain.CurrentDomain.BaseDirectory 2.Environment.CurrentDirectory 3.HttpRuntime.BinDirectory The path to the current application's/bin directory: Web程序 HttpCurrent.Context.Server.Mappath() HttpContext.Current返回当前请求的 HttpCo…
几种方法如下:非Web程序 1.AppDomain.CurrentDomain.BaseDirectory 2.Environment.CurrentDirectory 3.HttpRuntime.BinDirectory The path to the current application's/bin directory. Web程序 HttpCurrent.Context.Server.Mappath(); -----------------------------------------…