ASP常用函数:CStrIP()
程序员文章站
2023-12-04 18:15:10
作用:把长整型数字转为ip地址 <% function cstrip(byval annewip)  ...
作用:把长整型数字转为ip地址
<%
function cstrip(byval annewip)
dim lsresults
dim lntemp
dim lnindex
for lnindex = 3 to 0 step -1
lntemp = int(annewip / (256 ^ lnindex))
lsresults = lsresults & lntemp & "."
annewip = annewip - (lntemp * (256 ^ lnindex))
next
lsresults = left(lsresults, len(lsresults) - 1)
cstrip = lsresults
end function
%>
<%
function cstrip(byval annewip)
dim lsresults
dim lntemp
dim lnindex
for lnindex = 3 to 0 step -1
lntemp = int(annewip / (256 ^ lnindex))
lsresults = lsresults & lntemp & "."
annewip = annewip - (lntemp * (256 ^ lnindex))
next
lsresults = left(lsresults, len(lsresults) - 1)
cstrip = lsresults
end function
%>
下一篇: ASP常用函数:XMLEncode