/// <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; }