Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Restricting access from specific countries
Message
From
08/01/2007 17:14:42
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
 
To
08/01/2007 16:56:15
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01183554
Message ID:
01183643
Views:
13
>>Michel here you can find a list and is free http://ip-to-country.webhosting.info/node/view/6?XID=ac5319a5b0f784fd20d189d289325993
>
>Thanks, I downloaded the file. Excel recognizes it. When I open it in there, I see a comma delimited format. However, there is no dot. I wonder how someone would be able to know what IP is it exactly.

The formula to convert an IP Address of the form A.B.C.D to an IP Number is:

IP Number = A x (256*256*256) + B x (256*256) + C x 256 + D
so in vb.net will be something like
Function Ip2Number(ByVal ipAddress As String) As Long
    Dim str As String() = ipAddress.Split(CChar("."))
    Return CLng(CInt(str(0)) * 16777216 + CInt(str(1)) * 65536 + CInt(str(2)) * 256 + CInt(str(3)))
End Function
this is the condense version ;)
Alexandre Palma
Senior Application Architect
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform