如何从Intranet服务器获取客户端的PC名称 [英] how to Get clients pc name from Intranet server
本文介绍了如何从Intranet服务器获取客户端的PC名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮我从Intranet服务器获取客户端的计算机名称。
Please help me to get Client's Computer name from Intranet Server.
推荐答案
public string GetComputerName(string clientIP)
{
try
{
var hostEntry = Dns.GetHostEntry(clientIP);
return hostEntry.HostName;
}
catch (Exception ex)
{
return string.Empty;
}
}
这篇关于如何从Intranet服务器获取客户端的PC名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文