Code:
Dim ipadd 'As String;
ipadd =HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (string.IsNullOrEmpty(ipadd) || ipadd.Equals("unknown", StringComparison.OrdinalIgnoreCase))
{
ipadd = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}