做ASP小偷时.经常需要用到的函数.
来源:互联网 发布:上海游族网络 地址浦东 编辑:程序博客网 时间:2024/05/17 17:17
做ASP小偷时.经常需要用到的函数.
采集页面:
Function GetPage(url)
dim SendData,Retrieval
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "post", url, False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.setRequestHeader "User-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
.Send()
GetPage = BytesToBstr(.ResponseBody)
End With
Set Retrieval = Nothing
End Function
转换乱码:
Function BytesToBstr(body)
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 = "GB2312"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
获取指定的内容
Function GetContent(str,start,last,n)
If Instr(lcase(str),lcase(start))>0 then
select case n
case 0 '左右都截取(都取前面)(去处关键字)
GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))-Len(start)+1)
GetContent=Left(GetContent,Instr(lcase(GetContent),lcase(last))-1)
case 1 '左右都截取(都取前面)(保留关键字)
GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))+1)
GetContent=Left(GetContent,Instr(lcase(GetContent),lcase(last))+Len(last)-1)
case 2 '只往右截取(取前面的)(去除关键字)
GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))-Len(start)+1)
end select
Else
GetContent=""
End if
end function
删除HTML标签:
function DelHtml(htmlCode)
dim iStart,iEnd
dim sTemp
sTemp=htmlCode
iStart=instr(sTemp,"<")
iEnd=instr(sTemp,">")
do while iStart>0 and iEnd>0 and iEnd-iStart>0
sTemp=replace(sTemp,mid(sTemp,iStart,iEnd-iStart+1),"")
iStart=instr(sTemp,"<")
iEnd=instr(sTemp,">")
loop
DelHtml=sTemp
end function
- 做ASP小偷时.经常需要用到的函数.
- 学习Asp.Net经常会用到的函数集
- 学习Asp.Net经常会用到的函数集
- 学习Asp.Net经常会用到的函数集
- 学习Asp.Net经常会用到的函数集
- 27个Asp.Net经常会用到的函数集
- Asp.Net经常会用到的函数集
- 学习Asp.Net经常会用到的函数集
- asp.net经常会用到的27个函数集
- 学习Asp.Net经常会用到的函数集
- ASP.NET经常用到的27个函数
- ASP.NET中经常用到的二十七个函数
- ASP.NET网络编程中经常用到的函数集
- 21个Asp.Net经常会用到的函数集
- 使用时需要经常用到的几个设置选项!
- 经常用到的mysql函数
- 经常用到的一些函数
- 【经典之作】做网页时经常用到的代码集合
- 深入硬盘分区
- C++中的显式构造函数
- 自定义控件的拖动
- 最新Viking(维金)病毒专杀工具,纯VB编写。 (代码续)
- ASP.NET2.0控件一览
- 做ASP小偷时.经常需要用到的函数.
- [转贴]工作三年多了,我该怎么办!
- Java中的代理模式
- c#中的正则表达式
- ASP.NET实现从数据库中读取图片的方法
- 在Option条目中填充前导空格的方法
- 怎么用javascript进行拖拽
- 输入法超级技巧
- Struts 1.2.1新特点简介