diff --git a/Util/FileUtil.cs b/Util/FileUtil.cs index 10f63db..cf05976 100644 --- a/Util/FileUtil.cs +++ b/Util/FileUtil.cs @@ -159,21 +159,7 @@ namespace GeekDesk.Util public static string MakeRelativePath(string fromPath, string toPath) { - //if (string.IsNullOrEmpty(fromPath)) throw new ArgumentNullException("fromPath"); - //if (string.IsNullOrEmpty(toPath)) throw new ArgumentNullException("toPath"); - - //Uri fromUri = new Uri(fromPath); - //Uri toUri = new Uri(toPath); - - //if (fromUri.Scheme != toUri.Scheme) { return toPath; } // path can't be made relative. - - //Uri relativeUri = fromUri.MakeRelativeUri(toUri); - //string relativePath = Uri.UnescapeDataString(relativeUri.ToString()); - - //if (toUri.Scheme.Equals("file", StringComparison.InvariantCultureIgnoreCase)) - //{ - // relativePath = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); - //} + if (string.IsNullOrEmpty(toPath) || string.IsNullOrEmpty(fromPath)) return null; Uri file = new Uri(@toPath); // Must end in a slash to indicate folder Uri folder = new Uri(@fromPath);