While I was working on my last project, I need to detect my client ip address so that administrator can block the ip address if he want’s to. So after searching and reading few post I found out the following code block is the best. string ip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (!string.IsNullOrEmpty(ip)) { string[] ipRange = [...]