Nóta
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað aðskrá þig inn eða breyta skráasöfnum.
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað að breyta skráasöfnum.
The Uri class now recognizes strings that start with two forward slashes (//) as universal naming convention (UNC) paths on Unix operating systems. This change makes the behavior for such strings consistent across all platforms.
Change description
In previous versions of .NET, the Uri class recognizes strings that start with two forward slashes, for example, //contoso, as absolute file paths on Unix operating systems. However, on Windows, such strings are recognized as UNC paths.
Starting in .NET 5, the Uri class recognizes strings that start with two forward slashes as UNC paths on all platforms, including Unix. In addition, properties behave according to UNC semantics:
- Uri.IsUnc returns
true. - Backslashes in the path are replaced with forward slashes. For example,
//first\secondbecomes//first/second. - Uri.LocalPath doesn't percent-encode characters. For example,
//first/\uFFF0is not converted to//first/%EF%BF%B0.
Version introduced
5.0
Recommended action
No action is required on the part of the developer.