仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1741|回复: 19
打印 上一主题 下一主题

[学习教程] ASP教程之显示ip地址及包括收集功效的全套函数源...

[复制链接]
莫相离 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-2-3 23:28:32 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
asp对于服务器的要求较高,一般的服务器如果访问量一大就垮了,不得不重启。   以下代码包括有显示本机IP地址及近程收集功效的全套通用函数,是一些小偷法式,收集法式的最复杂的使用法式包,保举保藏.
  以下是源代码:
<%
Response.expires = 0
Response.expiresabsolute = now() - 1
Response.addHeader "pragma","no-cache"
Response.addHeader "cache-control","private"
Response.cachecontrol = "no-cache"
Response.CharSet = "GB2312"
Server.ScriptTimeOut = 9999
If request("ip")<>"" Then
response.write getip(Trim(request("ip")))
response.end
End if
Function GetPage(Path)
        t = GetBody(Path)
        GetPage=BytesToBstr(t,"UTF-8")
End function
Function GetPage2(Path)
        t = GetBody(Path)
        GetPage2=BytesToBstr(t,"GB2312")
End function
Function GetBody(url)  
        on error resume Next
        Set Retrieval = CreateObject("Microsoft.XMLHTTP")  
        With Retrieval  
        .Open "Get", url, False, "", ""  
        .Send  
        GetBody = .ResponseBody
        End With  
        Set Retrieval = Nothing  
End Function
Function BytesToBstr(body,Cset)
        dim objstream
        set objstream = Server.CreateObject("adodb.stream")
        objstream.Type = 1
        objstream.Mode =3
        objstream.Open
        objstream.Write body
        objstream.Position = 0
        objstream.Type = 2
        objstream.Charset = Cset
        BytesToBstr = objstream.ReadText  
        objstream.Close
        set objstream = nothing
End Function
Function FixStr(ByVal str, ByVal start, ByVal last, ByVal n)
Dim strTemp
on error resume Next
If InStr(str, start) > 0 Then
Select Case n
Case 0
strTemp = Right(str, Len(str) - InStr(str, start) - Len(start) + 1)
strTemp = Left(strTemp, InStr(strTemp, last) - 1)
Case Else
strTemp = Right(str, Len(str) - InStr(str, start) + 1)
strTemp = Left(strTemp, InStr(strTemp, last) + Len(last) - 1)
End Select
Else
strTemp = ""
End If
FixStr = strTemp
End Function
Public Function RemoveHtml(byval strContent)
Dim objReg ,strTmp
If strContent="" OR ISNull(strContent) Then Exit Function
   
Set objReg=new RegExp
objReg.IgnoreCase =True
objReg.Global=True
objReg.Pattern="<(.[^>]*)>"
strTmp=objReg.WordStr(strContent, "")
Set objReg=Nothing
RemoveHtml=strTmp
strTmp=""
End Function
Public Function GetIp(ip)
strhtml = getpage2("http://www.ip138.cn/index.php?ip="&Trim(ip)&"")
strhtml = fixstr(strhtml,"查 询 结 果<br><br>","<br><br>",0)
GetIp = WordStr(removehtml(strhtml),Trim(ip),"")
End Function
%>
Windows本身的所有问题都会一成不变的也累加到了它的身上。安全性、稳定性、跨平台性都会因为与NT的捆绑而显现出来;
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-12 06:49

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表