SQL数据库中的IP监视 [英] IP Monitoring in an SQL Database
本文介绍了SQL数据库中的IP监视的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何将客户端IP地址存储在数据库(即sql数据库)中.我需要为尝试在数据库中提交验证码的客户端存储日期,时间和IP地址,以便如果用户的尝试次数超过尝试的限制次数,就可以限制用户.
I want to know how to store an client IP address in a database, an sql database. I need to store the date, time and IP address for clients who tries to submit an CAPTCHA in a database so I can restrict a user if his tries exceed the limit number of tries.
推荐答案
尝试 Context.Request.UserHostAddress [ ^ ]
这会为您提供客户端用来连接到Internet的路由器的IP地址-距您可能的距离很近.
Try Context.Request.UserHostAddress[^]
This gives you the IP address of the router the client is using to connect to the internet - which is as close as you can get.
这篇关于SQL数据库中的IP监视的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文