suresh

suresh

  • NA
  • 293
  • 0

Server Error

Dec 12 2012 11:49 AM
I used below code to get IP Addres and System Name.

string ipAddress = IpAddress();
String comp_name = Dns.GetHostByAddress(ipAddress).HostName.ToUpper();

private string IpAddress()
{
string strIpAddress;
strIpAddress =
Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (strIpAddress == null)
strIpAddress = Request.ServerVariables["REMOTE_ADDR"];
return strIpAddress;
}

I am getting below Exception for some users they are not in the active directory and for some users it is working they are in the active directory.

So how to solve for the users are not in the active directory.

Exception Details: System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found

Answers (1)