My asp.net application will be distributed to different users. It should retrieve the domain and http type of a link automatically.
For example:
I need a method to retrieve either: http://abc.com and https://abc.com from those links automatically.
How can I do that?
thanks in advance.
You can construct a
Urifrom your full url and build your new url.However, you can use
uri.Host, but in case of any deployment where you will host your application on a port likehttp://abc.com:8087thenuri.Hostwill just returnabc.comanduri.Authoritywill returnabc.com:8087. Default port80will be ignored byuri.Authorityand work likeuri.Host.