Saturday, 15 May 2010

Invalid URL as a Valid URL in C# -



Invalid URL as a Valid URL in C# -

how can add together invalid url (but valid internal url) valid url, getting error when passing system.uri();

here uri code

new system.uri("mailto:dfo%20abns%20techn/dd-dwa/ind@adw-ngp", true)

according http://www.ietf.org/rfc/rfc6068.txt / should %-encoded in mailto 'address-part'. .net happily take:

new system.uri("mailto:dfotechn/dd-dwa/ind@adw-ngp");

but considered part of host.

encoding '/' characters gives:

new system.uri("mailto:dfo%20abns%20techn%2fdd-dwa%2find@adw-ngp")

which .net correctly parses adw-ngp host.

c#

No comments:

Post a Comment