This page has been moved:



One thought on “IPToCountry.NET

  1. Hi

    I’m a relative newbie in .NET so pardon my stupidity.

    I’m trying out your code and I’m getting an error on the following line (***) in this function.

    Public Shared Function GetCountryCode(ByVal IP As Long) As String

    **** Dim Index As Integer = Array.BinarySearch(_Ranges, IP, New RangeFinder)****
    If Index > -1 Then
    Return _Ranges(Index).Country
    End If
    End Function

    It seems that _Ranges is nothing.

    Here is what I’ve done:
    Dim cc As New IPToCountry
    ‘Dim ccode As String = cc.GetCountryCode(“”)

    Here is the error message:
    Value cannot be null. Parameter name: arrayHandleError at System.Array.BinarySearch(Array array, Object value, IComparer comparer) at magrosa.IPToCountry.GetCountryCode(Int64 IP) in c:\inetpub\wwwroot\magrosa\IpToCountry.vb:line 138 at magrosa.DBManager.PumpDbs() in c:\inetpub\wwwroot\magrosa\DBManager.vb:line 69 at magrosa.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\magrosa\index.aspx.vb:line 61 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain()

    Can you help. I would like to use this functionality



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s