예제 #1
0
        public static string MapServerPath(this HttpServerUtilityBase httpServerUtility, string localPath)
        {
            string domainRootLocalPath = httpServerUtility.MapPath("/");
            string relativeLocalPath   = ExtendedPath.GetRelativePath(domainRootLocalPath, localPath);
            string serverPath          = relativeLocalPath.Replace('\\', '/');

            return(serverPath);
        }
예제 #2
0
        public static string GetExternalLinkFromLocalPath(string fullLocalPath, string baseLocalPath, string baseUrl)
        {
            var relativePath = ExtendedPath.GetRelativePath(baseLocalPath, fullLocalPath);
            var relativeUrl  = relativePath.Replace("\\", "/");
            var fullUrl      = UrlPath.Combine(baseUrl, relativeUrl);

            return(fullUrl);
        }