From 896dc26f11a62b3de7050e5a2eaf4a6ce5b6e364 Mon Sep 17 00:00:00 2001 From: liufei Date: Tue, 14 Jun 2022 09:48:13 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=B8=BA=E7=A9=BA=E5=AF=BC=E8=87=B4=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Util/FileUtil.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) 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);