
Many thnaks to Jaws and Durbs
private string getHostName()
{
string hName = "";
System.Net.IPHostEntry host = new System.Net.IPHostEntry();
host = System.Net.Dns.GetHostEntry(HttpContext.Current.Re quest.ServerVariables["REMOTE_HOST"]);
//Split out the host name from the FQDN
if (host.HostName.Contains("."))
{
string[] sSplit = host.HostName.Split('.');
hName = sSplit[0].ToString();
}
else
{
hName = host.HostName.ToString();
}
return hName;
}


Leave a comment: