Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Blocking Spammers
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

youngboy
Starting Member

USA
1 Posts

Posted - 20 April 2009 :  15:52:04  Show Profile
Many spammers are from country's not from your location. We have a .NET page that sits in front of our default page that when you click the forum hyperlink from the menu tests where they are coming from and shows them a message or redirects them to the forum. In the page load event:



Imports System.Net
Imports WorldDomination.Net


Dim dottedip As String = Request.UserHostAddress.ToString
Dim Dot2LongIP As Double
Dim PrevPos As Double
Dim pos As Double
Dim num As Double


        For i = 1 To 4
            pos = InStr(PrevPos + 1, dottedip, ".", 1)
            If i = 4 Then
                pos = Len(dottedip) + 1
            End If
            num = Int(Mid(dottedip, PrevPos + 1, pos - PrevPos - 1))
            PrevPos = pos
            Dot2LongIP = ((num Mod 256) * (256 ^ (4 - i))) + Dot2LongIP
        Next

        Dim ipAddress As IPAddress = New IPAddress(Dot2LongIP)
        Dim country As String = ipAddress.Country
        Dim iso3166TwoLetterCode As String = ipAddress.Iso3166TwoLetterCode

        If iso3166TwoLetterCode.ToString.Trim.ToUpper = "US" Then
            Response.Redirect("~/forum/default.asp")
        End If



It's not perfect but it sure helps. We are based in the US and only expect US visitors. If you get people from outside the US then modify it appropriately.

Hope this helps.

Regards;
Dave
http://www.nbizmag.com

You'll need this binary:

http://ipaddressextensions.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=11046

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 April 2009 :  16:18:54  Show Profile  Visit HuwR's Homepage
we already have plenty of very satisfactory ways of preventing spammers without blocking entire nations from accessing our site, the web is global it is not meant to be limited to a particular country.

oh and ipaddresses are not a fool proof method of determining location either
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07