I’m using the Uri.TryCreate Method (String, UriKind, Uri) to validate Uris. But it changed my Uri. E.g.:
- original http://www.google.de/xjs/_/js/s/sy8,gf,tng,sy43,sy56,sy44,sy57,sy37,sy45,sy91,sy6,sy36,sy38,sy62,sy79,sy90,sy103,sy104,sy117,sy7,sy13,mbtt/rt=j/ver=H6TWgc21o-8.en_US./am=BA/d=0/sv=1/rs=AItRSTNxECC1gvngFsB87lvj_RnIn_MdHg
- manipulated
http://www.google.de/xjs/_/js/s/sy8,gf,tng,sy43,sy56,sy44,sy57,sy37,sy45,sy91,sy6,sy36,sy38,sy62,sy79,sy90,sy103,sy104,sy117,sy7,sy13,mbtt/rt=j/ver=H6TWgc21o-8.en_US/am=BA/d=0/sv=1/rs=AItRSTNxECC1gvngFsB87lvj_RnIn_MdHg
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
For validating Uri you should be using
Uri.IsWellFormedUriStringinstead ofUri.TryCreatemethod.Reference: http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx