蓝色空间 天气小偷

2018-09-06 10:44

阅读:671

  复制代码 代码如下:
<%@LANGUAGE=VBSCRIPTCODEPAGE=936%>
<%
------------------------------
程序名称:蓝色空间天气小偷
程序设计:小马
QQ:55100100
网站:蓝色空间)
日期:2005-11-15
------------------------------
DimstrArray(9,2),AreaID
strArray(1,0)=index.htm
strArray(1,1)=华北地区
strArray(2,0)=hd.htm
strArray(2,1)=华东地区
strArray(3,0)=hn.htm
strArray(3,1)=华南地区
strArray(4,0)=hz.htm
strArray(4,1)=华中地区
strArray(5,0)=db.htm
strArray(5,1)=东北地区
strArray(6,0)=xb.htm
strArray(6,1)=西北地区
strArray(7,0)=xn.htm
strArray(7,1)=西南地区
strArray(8,0)=ga.htm
strArray(8,1)=港澳台地区
AreaID=Request.QueryString
IfAreaID=ThenAreaID=1

SubGetPage()
DimstrUrl,strTmp,strTmp1


strUrl=

strTmp=GetHttpPage(strUrl)

strTmp1=strCut(strTmp,<tablewidth=750border=0cellpadding=2cellspacing=1bgcolor=4952BC>,<scriptlanguage=javascript>,2)
strTmp1=<tablewidth=750border=0cellpadding=2cellspacing=1bgcolor=4952BC>&strTmp1
strTmp1=Replace(strTmp1,width=750,width=760align=center)
strTmp1=Replace(strTmp1,bgcolor=4952BC,bgcolor=#cccccc)
strTmp1=Replace(strTmp1,bgcolor=#e4f0f8,bgcolor=#ffffffonmouseover=sbar(this)onmouseout=cbar(this))
strTmp1=<!--生成时间:&Now()&-->&vbCrLf&strTmp1

Response.WritestrTmp1
EndSub

FunctiongetHTTPPage(url)
OnErrorResumeNext
dimhttp
sethttp=Server.createobject(Microsoft.XMLHTTP)
Http.openGET,url,false
Http.send()
ifHttp.readystate<>4then
exitfunction
endif
getHTTPPage=bytesToBSTR(Http.responseBody,GB2312)
sethttp=nothing
IfErr.number<>0then
Response.Write<palign=center>服务器获取文件内容出错,请稍后再试!!!</p>
Err.Clear
EndIf
Endfunction


FunctionBytesToBstr(body,Cset)
dimobjstream
setobjstream=Server.CreateObject(adodb.stream)
objstream.Type=1
objstream.Mode=3
objstream.Open
objstream.Writebody
objstream.Position=0
objstream.Type=2
objstream.Charset=Cset
BytesToBstr=objstream.ReadText
objstream.Close
setobjstream=nothing
EndFunction

截取字符串,1.包括起始和终止字符,2.不包括
FunctionstrCut(strContent,StartStr,EndStr,CutType)
DimstrHtml,S1,S2
strHtml=strContent
OnErrorResumeNext
SelectCaseCutType
Case1
S1=InStr(strHtml,StartStr)
S2=InStr(S1,strHtml,EndStr)+Len(EndStr)
Case2
S1=InStr(strHtml,StartStr)+Len(StartStr)
S2=InStr(S1,strHtml,EndStr)
EndSelect
IfErrThen
strCute=<palign=center>没有找到需要的内容。</p>
Err.Clear
ExitFunction
Else
strCut=Mid(strHtml,S1,S2-S1)
EndIf
EndFunction

----------------------------
取得当前脚本名称
----------------------------
FunctionGetScript()
DimScriptAddress
ScriptAddress=CStr(Request.ServerVariables(SCRIPT_NAME))
GetScript=ScriptAddress
EndFunction
%>
<!DOCTYPEHTMLPUBLIC-//W3C//DTDHTML4.0Transitional//EN>
<HTML>
<HEAD>
<TITLE>天气预报</TITLE>
<metahttp-equiv=Content-Typecontent=text/html;charset=gb2312>
<style>
A:LINK{COLOR:#000000;TEXT-DECORATION:NONE}
A:VISITED{COLOR:#000000;TEXT-DECORATION:NONE}
A:HOVER{COLOR:blue;TEXT-DECORATION:NONE}
body{
margin:2px;
font-size:12px;
font-family:宋体,Arial;
}
td{font-size:12px;}
.tb0{
BORDER-RIGHT:#f1f1f11pxsolid;
PADDING-RIGHT:6px;
BORDER-TOP:#f1f1f11pxsolid;
PADDING-LEFT:6px;
BACKGROUND:#f1f1f1;
PADDING-BOTTOM:2px;
BORDER-LEFT:#f1f1f11pxsolid;
CURSOR:hand;
PADDING-TOP:2px;
BORDER-BOTTOM:#f1f1f11pxsolid;
}
.tb1{
BORDER-RIGHT:#9991pxsolid;
PADDING-RIGHT:6px;
BORDER-TOP:#9991pxsolid;
PADDING-LEFT:6px;
BACKGROUND:#ccc;
PADDING-BOTTOM:2px;
BORDER-LEFT:#9991pxsolid;
CURSOR:hand;
PADDING-TOP:2px;
BORDER-BOTTOM:#9991pxsolid;
}
</style>
</HEAD>
<BODY>
<tablewidth=100%border=0cellspacing=0cellpadding=0>
<tr><tdheight=3></td></tr>
</table>
<tablebgcolor=#f1f1f1align=centerwidth=760cellspacing=1cellpadding=3style=border:1solid#cccccc>
<tralign=center>
<TDclass=tb0noWraponmouseleave=mhHover(tb0)onmouseenter=mhHover(tb1)><Ahref=<%=GetScript()%>?1>华北地区</a></td>
<TDclass=tbsep></TD>
<TDclass=tb0noWraponmouseleave=mhHover(tb0)onmouseenter=mhHover(tb1)><Ahref=<%=GetScript()%>?2>华东地区</a></td>
<TDclass=tbsep></TD>
<TDclass=tb0noWraponmouseleave=mhHover(tb0)onmouseenter=mhHover(tb1)><Ahref=<%=GetScript()%>?3>华南地区</a></td>
<TDclass=tbsep></TD>
<TDclass=tb0noWraponmouseleave=mhHover(tb0)onmouseenter=mhHover(tb1)><Ahref=<%=GetScript()%>?4>华中地区</a></td>
<TDclass=tbsep></TD>
<TDclass=tb0noWraponmouseleave=mhHover(tb0)onmouseenter=mhHover(tb1)><Ahref=<%=GetScript()%>?5>东北地区</a></td>
<TDclass=tbsep></TD>
<TDclass=tb0noWraponmouseleave=mhHover(tb0)onmouseenter=mhHover(tb1)><Ahref=<%=GetScript()%>?6>西北地区</a></td>
<TDclass=tbsep></TD>
<TDclass=tb0noWraponmouseleave=mhHover(tb0)onmouseenter=mhHover(tb1)><Ahref=<%=GetScript()%>?7>西南地区</a></td>
<TDclass=tbsep></TD>
<TDclass=tb0noWraponmouseleave=mhHover(tb0)onmouseenter=mhHover(tb1)><Ahref=<%=GetScript()%>?8>港澳台地区</a></td>
</tr>
</table>
<tablewidth=100%border=0cellspacing=0cellpadding=0>
<tr><tdheight=3></td></tr>
</table>
<SCRIPTtype=text/javascript>
<!--//
functionsbar(st){
st.style.backgroundColor=#F5F5F5;
}
functioncbar(st){
st.style.backgroundColor=#ffffff;
}
functionmhHover(cls)
{
event.srcElement.className=cls;
}
functionmhClick(tbObj,cls)
{
event.srcElement.className=cls;
}
//-->
</SCRIPT>
<%
CallGetPage()
%>
<hrsize=1color=#ccccccwidth=770align=center>
<divalign=center>Copyright©2005<ahref=
</BODY>
</HTML>


评论


亲,登录后才可以留言!