Reputation: 765
I'm using the Uri.TryCreate
Method (String, UriKind, Uri) to validate Uris. But it changed my Uri. E.g.:
The method removed a dot after the en_US in the last line of the link. Can you tell me why it changes a correct URI? Or can you tell me another way using the Uri-Class to check if an Uri is correct? (I know there are some
Upvotes: 0
Views: 944
Reputation: 550
For validating Uri you should be using Uri.IsWellFormedUriString
instead of Uri.TryCreate
method.
Reference: http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx
Upvotes: 1