Wednesday, October 13, 2010

Get a RelativePath string

        public string GetRelativePath(string rootPath, string fullPath)
        {
            Uri uri1 = new Uri(rootPath);
            Uri uri2 = new Uri(fullPath);

            Uri relativeUri = uri1.MakeRelativeUri(uri2);

            return relativeUri.ToString();
        }

No comments:

Post a Comment