I am trying to understand how to refuse a request, I am mainly trying to implement a blocked list of IP addresses in my application to block spammers, and I do not want to return any response (just ignore the request), is this possible in ASP.NET?
Edit: some of the answers indicate that I can add them to the firewall, although this will certainly be better than it does not fit in my case. In short, I am adding a moderation section to my site where moderators will check messages waiting for spam moderation (filtered by a spam filler), I want the sender's IP address of some mail to be added to the list of blocked IP addresses when the message is marked as spam moderator, so I did it in the application.
Edit: Calling Response.End () returns the answer to the user (even if it is empty), the whole purpose of my question was not to return any answer. Is this possible (even out of curiosity)? There is also Response.Close (), which closes the socket, but it sends a notification (in TCP / IP) when it does, I just ignore it if it has never been received (i.e., sends nothing to the user )
thanks
source
share