I’m working on an Umbraco website and now I’ve built this contactform, on which users van send questions via e-mail to the admin.
I have this thought to “register” the IP from a client using Request.UserHostAddress, and when this client sends a message, i would disable the submitbutton for a minute or so. Just to avoid spam.
Anyone have a clue where I could store an array of these IP adresses temporarily?
?
Somewhere static I guess, but when I declare a list in my class, and there is only one user and he quits, the class gets recycled, or am I wrong?
Grtz and many thanks, Christophe
The simplest would probably be to use Asp.net cache.
You should be able to do a Cache[“iplist”] = yourList;
http://msdn.microsoft.com/en-us/library/18c1wd61%28v=vs.85%29.aspx
But be aware blocking by IP might “lock out” people running on the same IP (some companies and universities have the same external IP).