关于在ASP.NET中物理路径和虚拟路径的取得
来源:互联网 发布:淘宝直通车计划表格 编辑:程序博客网 时间:2024/05/16 22:29
关于在ASP.NET中物理路径和虚拟路径的取得
//Request.CurrentExecutionFilePath; 当前请求的虚拟路径 是这种格式:\虚拟目录名\admin\index.aspx
//Request.ApplicationPath //获取服务器上 ASP.NET 应用程序的虚拟应用程序根路径。\虚拟目录名(应用程序名)
以上都是虚拟目录中的文件路径,即是IIS中的路径。要得到真真的物理路径要在得到以上路径的基础上再加:
Server.MapPath(Request.ApplicationPath + "SPLConfig/ClassMap.xml ")//这样可能会有一个BUG
最好是这样
string m_ApplicationPath=Request.ApplicationPath;
if(this.m_ApplicationPath== " ")
this.m_ApplicationPath= "/ ";
if(!this.m_ApplicationPath.EndsWith( "/ "))
this.m_ApplicationPath += "/ "; //先判断一下 /
Server.MapPath(m_ApplicationPath+ "SPLConfig/ClassMap.xml ")
2005 地址Url 的新的访问方式
//this.Request.CurrentExecutionFilePath; //当前请求的虚拟忙碌中的路径
//this.Request.FilePath; //虚拟目录中的路径
//this.Request.PhysicalPath; //当前请求的物理路径
//this.Request.PhysicalApplicationPath;//应用程序的物理路径
//this.Request.Url.AbsoluteUri;//全部URL
Request.RawUrl 获得网址带变量 Request.UrlReferrer 获得网址不带变量
刷新本页面的方法 :
this.Response.Redirect(this.Request.Url.AbsoluteUri, true);
this.Response.Redirect(this.Request.Url.ToString());
定制方法的刷新
this.Response.Redirect(this.Request.CurrentExecutionFilePath + "?depid= " + this.hDepID.Value.ToString());
//Request.CurrentExecutionFilePath; 当前请求的虚拟路径 是这种格式:\虚拟目录名\admin\index.aspx
//Request.ApplicationPath //获取服务器上 ASP.NET 应用程序的虚拟应用程序根路径。\虚拟目录名(应用程序名)
以上都是虚拟目录中的文件路径,即是IIS中的路径。要得到真真的物理路径要在得到以上路径的基础上再加:
Server.MapPath(Request.ApplicationPath + "SPLConfig/ClassMap.xml ")//这样可能会有一个BUG
最好是这样
string m_ApplicationPath=Request.ApplicationPath;
if(this.m_ApplicationPath== " ")
this.m_ApplicationPath= "/ ";
if(!this.m_ApplicationPath.EndsWith( "/ "))
this.m_ApplicationPath += "/ "; //先判断一下 /
Server.MapPath(m_ApplicationPath+ "SPLConfig/ClassMap.xml ")
2005 地址Url 的新的访问方式
//this.Request.CurrentExecutionFilePath; //当前请求的虚拟忙碌中的路径
//this.Request.FilePath; //虚拟目录中的路径
//this.Request.PhysicalPath; //当前请求的物理路径
//this.Request.PhysicalApplicationPath;//应用程序的物理路径
//this.Request.Url.AbsoluteUri;//全部URL
Request.RawUrl 获得网址带变量 Request.UrlReferrer 获得网址不带变量
刷新本页面的方法 :
this.Response.Redirect(this.Request.Url.AbsoluteUri, true);
this.Response.Redirect(this.Request.Url.ToString());
定制方法的刷新
this.Response.Redirect(this.Request.CurrentExecutionFilePath + "?depid= " + this.hDepID.Value.ToString());
- [NET]关于在ASP.NET中物理路径和虚拟路径的取得
- 关于在ASP.NET中物理路径和虚拟路径的取得
- 关于在ASP.NET中物理路径和虚拟路径的取得
- 关于在ASP.NET中物理路径和虚拟路径的取得
- asp.net(c#)中相对路径(虚拟路径)和物理磁盘路径的转换
- ASP.NET 中在SERVER侧获取虚拟路径对应的物理路径
- ASP.NET的虚拟路径与物理路径
- 关于在javabean判断虚拟路径和获取物理路径
- .net开发笔记之三:取得与虚拟路径关联的物理路径
- 物理路径和虚拟路径的访问
- asp.net C#网站项目 获取物理路径、虚拟路径的方法
- asp.net C#网站项目 获取物理路径、虚拟路径的方法
- asp.net C#网站项目 获取物理路径、虚拟路径的方法
- asp.net中获取网站根目录和物理路径的方法
- asp.net取虚拟目录路径和物理路径
- 虚拟路径 物理路径
- asp.net 获取项目(网站)的物理、虚拟路径的方法
- C#中网站根路径、应用根路径、物理路径、绝对路径,虚拟路径的区别
- java处理word
- cookie 名称区分大小写吗?
- memcmp返回值
- 使用ASP常见问题解答
- Android 的大牛的博客 提供给大家参考
- 关于在ASP.NET中物理路径和虚拟路径的取得
- 毕业设计管理系统进行中
- SQL_Server2005函数大全
- VB.NET 获取HTML中的文字
- dede在发布文章时自动加上关键词链接
- 为什么id<sthDelegate> delegate 用的是assign
- JavaScript中关联数组对象
- js较验框架
- Android图片处理