IT码农库

您当前所在位置:首页 > 网络编程 > ASP编程

ASP编程

ASP常用函数:CLngIP()

互联网 2007-02-07ASP编程2121
作用:把IP地址转为长整型 <% Function CLngIP(ByVal asNewIP)     Dim lnResults     Dim lnIndex     Dim lnIpAry     lnIpAry = Split(asNewIP,&...
作用:把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
%>
大图广告(830*140)