Fully qualified domain name and port #
I am trying to create a link in an email so our users can have a shortcut into the subject of interest. However, I need the link to contain the FDQN and the port number to be part of the link?
I am aware of the following statement but not sure if applicable or not because it doesn't show the port:
System.Net.Dns.GetHostByName("localhost").HostName
I've seen the following forum link:
Does anyone know a way to get the FQDN of local machine in C#?
Does the por开发者_如何学Ct number need to be hard-coded?
The port will not show, as it is not part of the domain name.
You will need to hard code (or use a configurable value) the port number if you are not using a standard one (i.e. 80 for http).
精彩评论