I have code like this:
string uriString = @"C:\Temp\test.html";
Uri uri = new Uri(uriString);
bool goodCond = uri.IsWellFormedOriginalString();
But goodCond is false! What am I doing wrong?
Edit: Thanks Johannes and Catdirt. I'll focus my question: How do I convert a valid file path to a valid file Uri (using uri.IsWellFormedOriginalString as an indication to the validity of the Uri)? Take a look at this:
DirectoryInfo di = new DirectoryInfo(@"c:\temp");
FileInfo [] fis = di.GetFiles("test.html");
FileInfo fi = fis[0];
string uriString = fi.FullName;
Uri uri = new Uri(uriString);
bool goodCond = uri.IsWellFormedOriginalString()
Obviosly fi.fullName is a well formed path, but still goodCond is bad!