一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

asp 读取网页关键字

时间:2022-07-02 23:12:46 编辑:袖梨 来源:一聚教程网

<%

' 要取关键字的网页
RemoteURL = "http://111com.net

' 创建 xmlhttp连接
Set objXML = CreateObject("Microsoft.XMLHTTP")
objXML.Open "get", RemoteURL, False
objXML.Send 

' 取得返回数据
ResponsePage = objXML.responseText

Set objXML = Nothing

response.write ("Lenth of the original file: " & len(ResponsePage) & "
")
 

'
Thetext=lcase(ResponsePage)
for i=0 to 31 
 Thetext=Replace(Thetext,CHR(i)," ") 
next 
for i=33 to 47 
 Thetext=Replace(Thetext,CHR(i)," ") 
next 
for i=58 to 64
  Thetext=Replace(Thetext,CHR(i)," ") 
next 
for i=91 to 96 
  Thetext=Replace(Thetext,CHR(i)," ") 
next 
for i=123 to 255 
  Thetext=Replace(Thetext,CHR(i)," ") 
next 
Thetext=replace(Thetext,"  "," ")


public namearray
namearray=split (Thetext," ")
max=ubound(namearray)
Thetext=" "
for counter=0 to max
  if instr (Thetext, namearray(counter))=0 then
   Thetext=Thetext & " " & namearray(counter)
namearray(counter)=""
 end if
namearray(counter)=""
next
 

response.write (Thetext & "
Lenth of keywords: " & len(Thetext))
%>



Script provided by 中国WEB第一站

热门栏目