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
 
Back
Top