For the file C:\filename.txt
,
File.Exists(@"c:\filename.txt/");
returns true
. But when we then try to open with that filename, it fails.
The filename is bad because of the trailing /. But how can we test to know if a file is valid as this tells me it is not only ok, but that the file exists.
Update: In a standard command line test app the results are as expected (false). But in my custom uri handler the File.Exists() returns true. It's really bizarre.