why using method Uri.TryCreate I get BOOL TRUE if the URI is not in Uri.Schema??.
Here the Uri.Schema from MSDN:
http://msdn.microsoft.com/en-us/library/system.uri.scheme.aspx
Try for example a string "mail:foo" it return True and I do not understand why.
Any ideas? Maybe a bug in MS framework or maybe a bug in my head :-)?
public static bool IsValidUriHttp(string uriString)
{
Uri test = null;
return Uri.TryCreate(uriString, UriKind.Absolute, out test);
}
Thanks
If you see the Documentation then it says that:
So it just shows the scheme no matter if it was a known scheme or not.
Also the
Uri.TryCreate()tries to create a Uri with any kind of scheme that it feels may be okay.Like i tried this and see what i got: