I'm trying to block access to my website if the user tries to login more than 6 times. I'm currently using this code to get the client IP address to block his access:
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
The problem is that this will return the public IP address. If I use this address I may be blocking access to the whole client network.
Is there any way I can block only the user that making the login attempts?