Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Do you see anything wrong with this code?

Do you see anything wrong with this code?

Scheduled Pinned Locked Moved ASP.NET
sysadminquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AlexeiXX3
    wrote on last edited by
    #1

    The value is in the cache for more than a minute, does it have something to do with the datatype being saved? I already tryed utcnow but the result is the same, and also, i tryed using a timespan of 1 minute and guess what... not working either, i dont think its my machine, because it doent work either on my server If you have the time, check it please I know i could use the NoBot control in ajax but i really want to know whats wrong with this

    Private Function IsRobot() As Boolean
    Dim IP As String = Me.Request.UserHostAddress
    Dim key As String = "Contact_" & IP
    Dim obj As Object = Cache(key)
    Dim Counter As Integer = 0
    If obj Is Nothing Then
    Cache.Insert(key, Counter, Nothing, Now.AddMinutes(1), Cache.NoSlidingExpiration)
    Else
    Counter = obj
    End If
    If Counter >= 5 Then
    Me.lblError.Text = "Too many emails"
    Me.lblError.Visible = True
    Return True
    End If
    Cache(key) = Counter + 1
    Return False
    End Function

    Thanks for your time

    Alexei Rodriguez

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups