Public Shared Function GetClientIPAddress() As String
Dim strIpAddress As String
Try
strIpAddress = HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If strIpAddress = "" Then
strIpAddress = HttpContext.Current.Request.ServerVariables("REMOTE_ADDR")
End If
Catch
strIpAddress = ""
End Try
Return strIpAddress
End Function