System.Web.VirtualPathUtility.ToAbsolute C# (CSharp) Метод

ToAbsolute() публичный статический Метод

public static ToAbsolute ( string contentPath ) : string
contentPath string
Результат string
        public static string ToAbsolute(string contentPath)
        {
            var context = Dependency.Resolve<IHttpContextAccessor>().HttpContext;
            return GenerateClientUrl(context.Request.PathBase, contentPath);
        }

Usage Example

 public void ToAbsolute8_b()
 {
     Assert.AreEqual("/blah2/", VPU.ToAbsolute("/blah1/../blah2/"));
     Assert.AreEqual("/blah2/", VPU.ToAbsolute("/blah1//../blah2/"));
     Assert.AreEqual("/blah2/", VPU.ToAbsolute("/blah1/\\../blah2/"));
     Assert.AreEqual("/blah2/", VPU.ToAbsolute("/blah1\\\\../blah2/"));
     Assert.AreEqual("/blah1/blah2/", VPU.ToAbsolute("/blah1/./blah2/"));
 }
All Usage Examples Of System.Web.VirtualPathUtility::ToAbsolute