converts a string IP address ("192.168.0.1") to a Long number (3232235521). One of the reasons to does this would is to store IP addresses in databases. Numbers greatly reduce the size required to store this information.
inputs:asnewip-string IP Address ("192.168.0.1") to convert to a number.
Returns:returns a Long Integer representing the IP address (3232235521)
Assumes:this function assumes that your IP addresses has 4 integers delimited by decimals and that numbers range F Rom 0 to 255.
Function Clngip (ByVal asnewip)
Dim lnresults
Dim Lnindex
Dim lnipary
' Split the IP address using the dot as a delimiter
lnipary = Split (Asnewip, ".", 4)
' Loop through each number into the IP address
for lnindex = 0 to 3
' If we are not working with the last number ...
If Not Lnindex = 3 Then
' Convert the number to a value range of that can is parsed from the others
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.