Uri doesn't construct with certain URI's

P

PlayerGiro

Here is a valid URI according to the RFC:

magnet:?xt=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C

However the following code throws an exception:

System.Uri u = new System.Uri(magnet:?xt=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C);

I'll bet it's because there's no forward-slashes after the colon.
However forward slashes are only for hierarchical namespaces (e.g.,
URLS).

Is this class a misnomer? Maybe it should be renamed URL? Or am I
missing something?
 
J

JD

I just tried your example, except that I enquoted the constructor argument,
and it worked fine.

- J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top