从物理路径获取相对虚拟路径 [英] Getting relative virtual path from physical path

查看:21
本文介绍了从物理路径获取相对虚拟路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从asp.net中的物理路径获取相对虚拟路径?反向方法如下:

How can I get the relative virtual path from the physical path in asp.net? The reverse method is like below:

Server.MapPath("Virtual Path Here");

但是上面方法的逆向是什么?

But what is the reverse of the upper method?

推荐答案

也许 这个问题 就是你要找的.他们建议:

Maybe this question is what you're looking for. There they suggest:

String RelativePath = AbsolutePath.Replace(Request.ServerVariables["APPL_PHYSICAL_PATH"], String.Empty);

这篇关于从物理路径获取相对虚拟路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆