判断HostName是否有值

This commit is contained in:
陈国伟 2021-07-29 14:29:12 +08:00
parent 299d81b76b
commit 2956fa406a

View File

@ -188,7 +188,11 @@ namespace FastGithub
}
var globalPropreties = IPGlobalProperties.GetIPGlobalProperties();
yield return globalPropreties.HostName;
if (string.IsNullOrEmpty(globalPropreties.HostName) == false)
{
yield return globalPropreties.HostName;
}
foreach (var item in globalPropreties.GetUnicastAddresses())
{
if (item.Address.AddressFamily == AddressFamily.InterNetwork)