ASP常用函数:CLngIP()
作用:把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
%>
相关推荐
-
ASP常用函数:CLngIP()
作用:把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) *
-
ASP常用函数收藏乱七八糟未整理版
<% '******************************************************************* '取得IP地址 '******************************************************************* Function Userip() Dim GetClientIP '如果客户端用了代理服务器,则应该用ServerVariables("HTTP_X_FORWARDED_FOR&
-
asp 常用函数用法
Array() FUNCTION: 返回一个数组 SYNTAX: Array(list) ARGUMENTS: 字符,数字均可 EXAMPLE: <% Dim myArray() For i = 1 to 7 Redim Preserve myArray(i) myArray(i) = WeekdayName(i) Next %> RESULT: 建立了一个包含7个元素的数组myArray myArray("Sunday",&
-
ASP常用函数:XMLEncode
输出RSS和XML时经常用到,和HTMLEncode还不完全一样 原理: Character Converted To " " ' ' & & < < > > 代码<%Function XMLEncode(byVal sText) sText = Replace(sText, "&" , "&") sText = Replace(sText, "
-
ASP常用函数:Trace()
复制代码 代码如下: <% '//---- 输入字符串并结束当前页面(调试用),函数可以也命名为Debug ----// Function Trace(s) On Error Resume Next Response.Write(s & vbCrLf) Response.End() End Function %> 下面的是个修改升级版,还在测试中... 复制代码 代码如下: <% '//---- 输入字符串并结束当前页面(调试用) ---
-
ASP常用函数:Delay()
代码很短,但是很经典,单位是秒,就是未测试过服务器资源消耗怎么样: <% Function Delay(s) Dim t = Now() While DateDiff("s", t, Now) < s Wend End Function %> 转载自:http://jorkin.reallydo.com/article.asp?id=224
-
ASP常用函数:CStrIP()
作用:把长整型数字转为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 & "." a
-
ASP常用函数:ReplaceHTML
<% '去掉HTML标记 Public Function ReplaceHTML(Textstr) Dim Str, re Str = Textstr Set re = New RegExp re.IgnoreCase = True re.Global = True re.Pattern = "<(.[^>]*)>" Str = re.Replace(Str, "") Set R
-
ASP常用函数:ArrayToxml
<% Public Function ArrayToxml(DataArray, Recordset, row, xmlroot) Dim i, node, rs, j If xmlroot = "" Then xmlroot = "xml" Set ArrayToxml = Server.CreateObject("msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
-
ASP常用函数:HTMLDecode
<% Function HTMLDecode(sText) Dim I sText = Replace(sText, "&" , Chr(38)) sText = Replace(sText, """", Chr(34)) sText = Replace(sText, "<" , Chr(60)) sText = Replace(sText, ">&q
随机推荐
- JS 正则表达式中小括号的应用
- 网站程序员如何应对web标准第1/2页
- MongoDB查询字段没有创建索引导致的连接超时异常解案例分享
- Python下的常用下载安装工具pip的安装方法
- ASP.NET Ajax级联DropDownList实现代码
- JavaScript变量声明详解
- Javascript 定时器调用传递参数的方法
- 异步加载JS、CSS代码(推荐)
- asp.net中的cookie使用介绍
- php常用字符函数实例小结
- PHP微信开发之查询城市天气
- Mysql更改默认引擎为Innodb的步骤方法
- PHP中余数、取余的妙用
- 用JS在浏览器中创建下载文件
- js随机生成字母数字组合的字符串 随机动画数字
- Android编程使用Service实现Notification定时发送功能示例
- 详解Android中AsyncTask机制
- 从CentOS安装完成到生成词云python的实例
- vue微信分享出来的链接点开是首页问题的解决方法
- 浅析mysql迁移到clickhouse的5种方法
