public function bytesToBstr($body,$cset)
{
$objstream = new Server.CreateObject("adodb.stream");//这个地方是什么...流?
$objstream->Type = 1;
//...
$text = $objstream->ReadText;//这里是要返回???
$objstream->Close;
$objstream = null;
}
public function steal()
{
if ($this->src_ == "") {
$http = new server.createobject("MSXML2.XMLHTTP");//这里是xml??
$http->open ;//...
//...
if ($http->readystate!=4) {
exit();//这里是中指执行
}
$this->value_ = $this->bytesToBstr(Http.responseBody,"GB2312");
$this->isGet_ = true;
$http = null;
if ($err->nulber!=0) { //这个应该不对
$err->Clear;
}
else {
echo "<script language='javascript'>alert('请先设置src属性!');</script>";
}
}
}
public function change($oldStr,$str)
{
if ($this->isGet_ = false) {
$this->steal();
$this->value_ = str_replace($this->value_,$oldStr,$str);//这里用的是php的函数
}
}
public property let src(str) '
src_=str
end property
public property get value '
value=value_
end property
Public Property get Version
Version="Version 2005"
End Property
private sub class_initialize()
value_=""
src_=""
isGet_= false
end sub
private sub class_terminate()
end sub
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
public sub steal() '
if src_<>"" then
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",src_ ,false
Http.send()
if Http.readystate<>4 then
exit sub
end if
value_=BytesToBSTR(Http.responseBody,"GB2312")
isGet_= True
set http=nothing
if err.number<>0 then err.Clear
else
response.Write("<script>alert(""请先设置src属性!"")</script>")
end if
end sub
public sub change(oldStr,str)
if isGet_= false then call steal()
value_=replace(value_ , oldStr,str)
end sub
public sub cutX(head,bot)
if isGet_= false then call steal()
if instr(value_,head)>0 and instr(value_,bot)>0 then
value_=mid(value_ ,instr(value_ ,head),instr(value_ ,bot)-instr(value_ ,head)+len(bot))
else
value_= "<p align=""center"">单词不存在"
end if
end sub
end class
%>
<html><head>
<%wd=request("word")
dim myThief,page
set myThief=new clsThief
myThief.src="http://www.baidu.com/baidu?ie=gb2312&bs=&sr=&z=&ct=1048576&cl=3&f=8&word="&wd&""
myThief.steal
myThief.cutX "<ol>","</ol>"
myThief.change "src=""IMAGES/","src=""http://www.baidu.com/IMAGES/"
myThief.change "<br>以上结果由 <a href=""http://www.dreye.com.cn"" target=_blank>Dr.eye译典通字典</a> 提供",""
page=myThief.value
set myThief=nothing
page=""&page&""
%>
<title><%=wd%>解释</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
td,body{font-size:14.8px;color:#000}a:link{color:#000066;text-decoration:none}a:visited{COLOR:#000066;
TEXT-DECORATION:none}a:active{color:red;text-decoration:none}a:hover{color:green;text-decoration:underline}
.unnamed1 { font-size: 9pt; line-height: 20px}
.font12_bold{