Forum Topics : Support / ASP code for IP number
I guess most people managed this simple task but I saw someone asking about it and it's not on the "handbook" pages.
Simple classic ASP code to convert the IP:
Function ConvertIP(sIP)
Dim arr
arr = Split(sIP,".")
ConvertIP = arr(0)*16777216 + arr(1)*65536 + arr(2)*256 + arr(3)
End Function
I guess you could do some error handling as well but if you take the IP from Request.ServerVariables("REMOTE_HOST") it's always the correct format.
Simple classic ASP code to convert the IP:
Function ConvertIP(sIP)
Dim arr
arr = Split(sIP,".")
ConvertIP = arr(0)*16777216 + arr(1)*65536 + arr(2)*256 + arr(3)
End Function
I guess you could do some error handling as well but if you take the IP from Request.ServerVariables("REMOTE_HOST") it's always the correct format.
