public IdentityServerWithRecaptcha WithFailuresForIpAddress(string ipAddress, int numberOfFailures) { for (var failures = 0; failures < numberOfFailures; ++failures) { LoginStatistics.IncrementFailedLoginsForUserAndIpAddress(string.Empty, IPAddress.Parse(ipAddress)); } return(this); }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Context.User.Identity.Name)) { try { LoginStatistics item = new LoginStatistics(); item.UserName = Context.User.Identity.Name; item.WhenLastDate = DateTime.Now; item.Ip = Request.UserHostAddress; item.Client = 0; DataHelper.AddLoginStatistic(item); } catch { } } ListNews = DataHelper.GetActiveNewsLast5(); }