4

Is there any downside to ALWAYS using UriKind.RelativeOrAbsolute (C# / Silverlight), aside from some minor loss of performance, instead of checking if the path is relative or not and using the correct UriKind?

Uri nav = new Uri(path, UriKind.RelativeOrAbsolute);

Stated otherwise: Using the above code, is there ever a time when it will be evaluated as a relative path when it should have been evaluated as an absolute path? Is one checked before the other? Is it possible a pathcould satisfactorily be a relative path && an absolute path?

4

1 回答 1

0

我发现了一个非常有趣的视频和下面的一些描述

哟可以通过

uri 种类描述

此文本是描述的一部分。请通过它,我希望它会清除您的概念。

但是 UriKind.RelativeOrAbsolute 呢?这有点棘手。我能想到的最好的办法是我们只是要求运行时自己解决。它将尝试清理我们提供的 UriString 并找出资源的位置。

于 2013-09-12T11:34:22.597 回答