当前位置:编程学习 > asp >>

一小偷类!!有兴趣的可以看看!!

类代码 (cls.asp)
<%
Class clsThief
Private strUrl ' 偷取地址
Private strValue ' 偷取的内容,所有内容
Private strResult ' 偷取结果,可以具体某一块内容
Private flag ' 是否已经偷过
'-------初始化类--------'
Private Sub Class_Initialize()
strUrl=""
strValue=""
strResult=""
flag=false
End Sub
'------类结束-----------'
Private Sub Class_Terminate()
End Sub
'------初始化url属性----'
Public Property Let url(ByVal iurl)
strUrl = iurl
End Property
'------返回输出内容----'
public property get value
value=strValue
end property
public property get result
result=strResult
end property
'------------文字处理-----------'
private 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
'-------文字处理-------'
private Function Ichange(str)
Dim finalStr
Dim icharCode
Dim inextCode
For i = 1 To lenb(str)
icharCode = ascb(midb(str,i,1))
If icharCode < &H80 Then
finalStr = finalStr & chr(icharCode)
Else
inextCode = ascb(midb(str,i+1,1))
finalstr = finalstr & chr(clng(icharCode) * &H100 + cint(inextCode))
i = i + 1
End If
Next
Ichange = finalStr
End Function
'-------内容抓取--------'
Public sub Seize()
if strUrl<>"" then
dim iconnect
Set iconnect = CreateObject("Microsoft.XMLHTTP")
补充:asp教程,高级应用 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,