Checking if client and server are the same machine.

bool IsClientAndServerSame(HttpRequest request)
{
String remoteAddress = request.UserHostAddress;
if (remoteAddress == null remoteAddress.Length == 0)
return false;
if (remoteAddress == "127.0.0.1" remoteAddress == "::1")
return true;
if (remoteAddress == request.LocalAddress)
return true;
return false;
}

Comments

Popular posts from this blog

Google Appengine

Blackberry Playbook

What is up with RIM?