物理路径映射

  private string GetMapPath(string virtualPath)
        {
            string fullPath;
            if (virtualPath.StartsWith("~"))
            {
                fullPath = HostingEnvironment.MapPath(virtualPath);
            }
            else
            {
                fullPath = HostingEnvironment.MapPath("~/" + virtualPath);
            }

            return fullPath;
        }

  

posted on 2016-05-03 09:39  蓝蓝的天2016  阅读(250)  评论(1编辑  收藏  举报