ASP常用函数:CLngIP()

网络编程 2021-07-05 10:58www.168986.cn编程入门
作用:把IP地址转为长整型

<%
Function CLngIP(ByVal asNewIP)
    Dim lnResults
    Dim lnIndex
    Dim lnIpAry
    lnIpAry = Split(asNewIP, ".", 4)
    For lnIndex = 0 To 3
        If Not lnIndex = 3 Then
            lnIpAry(lnIndex) = lnIpAry(lnIndex) * (256 ^ (3 - lnIndex))
        End If
        lnResults = lnResults + lnIpAry(lnIndex)
    Next
    CLngIP = lnResults
End Function
%>

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by