自动登录由IP确定的用户

时间:2014-12-01 13:32:04

标签: c# asp.net webforms asp.net-membership forms-authentication

我想确定用户背后的IP,以及它是否与特定IP匹配 地址是本地网络,用户应该登录。

它应该与这样的东西一起工作,并且不会在global.asax的某个地方成为合适的地方吗?

if (Request.UserHostAddress.ToString() == "89.67.88.68")
{
  System.Web.Security.Membership.ValidateUser("<someDefaultUsername>", "<someDefaultPassword>");    
}

有人可以帮助放置方法吗?

最好的问候。

0 个答案:

没有答案
相关问题