I am building an intranet site that will display different lists based on the computer name because different computers are in different areas, is there a way (within a cont
I got it working using the following:
string IP = Request.UserHostName;
string compName = CompNameHelper.DetermineCompName(IP);
code from compnamehelper:
public static string DetermineCompName(string IP)
{
IPAddress myIP = IPAddress.Parse(IP);
IPHostEntry GetIPHost = Dns.GetHostEntry(myIP);
List compName = GetIPHost.HostName.ToString().Split('.').ToList();
return compName.First();
}