ASP常用函数:CStrIP()
程序员文章站
2023-11-16 21:50: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
%>
下一篇: Java实现的简单数字处理类及用法示例