物理路径转网络路径

    /// <summary>
        /// 物理路径转网络路径
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public string urlconvertor(string path)
        {
            string tmpRootDir = HttpContext.Current.Server.MapPath(System.Web.HttpContext.Current.Request.ApplicationPath.ToString());//获取程序根目录
            string temp = "\" + path.Replace(tmpRootDir, ""); //转换成相对路径
            temp = temp.Replace(@"", @"/");
            return temp;
        }
原文地址:https://www.cnblogs.com/gaocong/p/7308796.html