Click here to Skip to main content
16,009,238 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello,

I have a script that gets the users IP and saves it to the DB. Problem is that it how to add logic.
i have a website and i want to any user see only home page but not cart any item.
user click item then redirect page "error.aspx" and show error page.

i want to any user not see my website in china into india.etc

but i don't know ..how to solve this problem.

Thank you
Posted
Updated 19-Aug-15 18:54pm
v2
Comments
Sergey Alexandrovich Kryukov 20-Aug-15 0:57am    
We already have two Great Walls in China. To me, this is such a global abuse...
—SA

It's difficult to tell what country someone comes from. Even if you could, they could just disable JS to get around that.You can use third party API to find the Geo Location and block that user.

Otherwise refer this tutorial to block IP :

How to Block Country and IP Addresses in ASP.NET using HTTPModule?
 
Share this answer
 
IP address blocking will help you block websites from certain locations viewing it - IP address blocking in ASP.NET[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900