string GetRelativePath(string fullPath, string basePath) { if(!basePath.EndsWith(@"\")) basePath += @"\"; var relativeUri = new Uri(basePath).MakeRelativeUri(new Uri(fullPath)); return relativeUri.ToString().Replace("/", @"\"); }