Specifying port in System.Uri

  • Thread starter Thread starter Keith Patrick
  • Start date Start date
K

Keith Patrick

I'm trying to create System.Uri object from a string, using a custom port,
but the ctor for Uri is only using the protocol to determine the port, so:
new Uri("http://localhost/MyService:9998") has a port of 80 instead of 9998,
and Uri does not parse out the 9998 into any property. Is this correct
behavior? If so, is there a better way to specify a port with the string in
a URI?
 
heh...royal screwup on my part. I didn't have the port after the host; I
had it where the querystring should be
 

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

Back
Top