c# 虚拟路径转换为绝对路径
/// <summary> /// 解析相对Url /// </summary> /// <param name="relativeUrl">相对Url</param> public static string ResolveUrl(string relativeUrl) { if (string.IsNullOrWhiteSpace(relativeUrl)) return string.Empty; relativeUrl = relativeUrl.Replace("\\", "/"); if (relativeUrl.StartsWith("/")) return relativeUrl; if (relativeUrl.Contains("://")) return relativeUrl; return VirtualPathUtility.ToAbsolute(relativeUrl); }
从此山高路远,纵马扬鞭。愿往后旅途,三冬暖,春不寒,天黑有灯,下雨有伞。此生尽兴,不负勇往。