Merajuddin Ansari

Merajuddin Ansari

  • NA
  • 90
  • 14.6k

unable to get some client computer name visiting my intranet

Dec 6 2017 12:47 AM
Hi,
i am unable to get some client computer name not all visiting my intranet site.any one can help me on this please.
public string GetComputerName(string clientIP)
{
try
{
var hostEntry = Dns.GetHostEntry(clientIP);
return hostEntry.HostName;
}
catch (Exception ex)
{
return string.Empty;
}
}
//call GetComputerName function
string computerName=GetComputerName(HttpContext.Current.Request.UserHostAddress)

Answers (3)