I don't see that behavior. A URL uses /
, not \
for pathing. Passing the value you gave to a Uri
results in an exception because it cannot figure out what type of URI you're dealing with here.
var items = new [] {
"https://tempuri.org",
"//server/share",
"//server",
"/server",
@"\V530-DANIS"
};
foreach (var item in items)
{
try
{
var isUnc = new Uri(item, UriKind.Absolute).IsUnc;
Console.WriteLine($"{item} = {isUnc}");
} catch (Exception e)
{
Console.WriteLine($"{item} = ERROR: {e.Message}");
}
};