简体   繁体   English

完全限定的域名和端口号

[英]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? 但是,我需要链接包含FDQN和端口号才能成为链接的一部分吗?

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#? 有谁知道在C#中获取本地计算机的FQDN的方法吗?

Does the port 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 (ie 80 for http). 如果您不使用标准端口号(例如,http使用80),则需要对端口号进行硬编码(或使用可配置的值)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM