What is Uri.LocalPath defined to do with non local paths?
Question
The docs for Uri.LocalPath don't say what happens if you feed it a non local path like http://stackoverflow.com/
. Does anyone know of a source that gives the official spec for how it handle this?
I'm wanting to know what kind of gotchas and corner cases it might have so I can't be sure I've got thing right by just trying things.
(alternately does anyone known of a robust way to check if a Uri is or is not local? Particularly, is it something I can access via the file-system)
Solution
You're violating the pre-conditions by using it on a Uri that is not a "file name". Thus, as I see it, it can return whatever it pleases.
To see if a Uri is a filename, use Uri.IsFile
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow