[会员中心]  [发布文章][发布软件]  [中文繁體]
 文章·资料  电脑软件  手机软件  网站源码
    本 站 搜 索
[选项]
   推 荐 文 章        More...
华硕易电脑(ASUS Eee PC 10..
先来段开场白:为了外出携带方便,..
Acronis True Image 使用..
  一款可以在Windows下使用全..
Norton Ghost 使用详解
一、分区备份   使用Ghost进..
    文 章 阅 读 排 行
Microsoft SQL Server 2000..
  对于第一次安装 Microsoft SQ..
ASP:Dimac W3 JMail 发送..
【发送邮件测试代码下载】压..
ASP:Persits ASPMail 发送..
【发送邮件测试代码下载】压..
VMware Workstation:安装..
编写这份虚拟机安装的图文教程,..
华硕易电脑(ASUS Eee PC 10..
先来段开场白:为了外出携带方便,..
ASP:Microsoft CDO 发送邮..
【发送邮件测试代码下载】压..
 文 章 信 息
做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
GetC
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

文章作者:未知  更新日期:2009-07-07
〖文章浏览:〗〖打印文章〗〖发送文章
阅读说明
·本站大部分文章转载于网络,如有侵权请留言告知,本站即做删除处理。
·本站法律法规类文章转载自[中国政府网(www.org.cn)],相关法律法规如有修订,请浏览[中国政府网]网站。
·本站转载的文章,不为其有效性,实效性,安全性,可用性等做保证。
·如果有什么问题,或者意见建议,请联系[网站管理员]。
  当百网
  本站使用【啊估文章软件站】网站系统    网站管理员留言簿