- using System.Net;
- public class NetworkUtils
- {
- public static string GetHostName(IPAddress ipAddress)
- {
- IPHostEntry entry = Dns.GetHostEntry(ipAddress);
- return entry.HostName;
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/210620134208.html
来源: http://www.codesnippet.cn/detail/210620134208.html