您现在的位置是:网站首页> 编程资料编程资料
ASP常用函数:CStrIP()_ASP基础_
2023-05-25
143人已围观
简介 ASP常用函数:CStrIP()_ASP基础_
作用:把长整型数字转为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
%>
相关内容
- On Error Resume Next 语句_ASP基础_
- IIS 错误 Server Application Error 详细解决方法_ASP基础_
- Eval 函数 | Execute 语句 | ExecuteGlobal 语句使用说明_ASP基础_
- [转]ASP常用函数:TimeZone_ASP基础_
- HTTP_HOST 和 SERVER_NAME 的区别详解_ASP基础_
- ServerVariables集合检索预定的环境变量_ASP基础_
- 对象标记具有无效的 'MSWC.MyInfo' ProgID_ASP基础_
- [转]ASP实现关键词获取(各搜索引擎,GB2312及UTF-8)_应用技巧_
- ASP常用函数:Trace()_应用技巧_
- ASP常用函数:Delay()_ASP基础_
