0

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 port number need to be hard-coded?

Community
  • 1
  • 1
Rod
  • 14,529
  • 31
  • 118
  • 230

1 Answers1

1

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).

Oded
  • 489,969
  • 99
  • 883
  • 1,009