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(“216.104.194.173″)
——————————
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
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(“216.104.194.173″)
——————————
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
Regards
George
George
November 9, 2006 at 7:01 pm