蓝色空间 天气小偷
程序员文章站
2022-06-21 23:20:25
复制代码 代码如下:<%@language="vbscript" codepage="936"%> <% '------------------...
复制代码 代码如下:
<%@language="vbscript" codepage="936"%>
<%
'------------------------------
'程序名称:蓝色空间 天气小偷
'程序设计:小马
'qq:55100100
'网站:http://www.bluespace.cn(蓝色空间)
'日期:2005-11-15
'------------------------------
dim strarray(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
if areaid = "" then areaid = 1
sub getpage()
dim strurl,strtmp,strtmp1
strurl = "http://weather.265.com/"&strarray(areaid,0)
strtmp = gethttppage(strurl)
strtmp1 = strcut(strtmp,"<table width=""750"" border=""0"" cellpadding=""2"" cellspacing=""1"" bgcolor=""4952bc"">","<script language=""javascript"">",2)
strtmp1 = "<table width=""750"" border=""0"" cellpadding=""2"" cellspacing=""1"" bgcolor=""4952bc"">"&strtmp1
strtmp1 = replace(strtmp1,"width=""750""","width='760' align='center'")
strtmp1 = replace(strtmp1,"bgcolor=""4952bc""","bgcolor='#cccccc'")
strtmp1 = replace(strtmp1,"bgcolor=""#e4f0f8""","bgcolor='#ffffff' onmouseover=""sbar(this)"" onmouseout=""cbar(this)""")
strtmp1 = "<!--生成时间:"&now()&"-->"&vbcrlf&strtmp1
response.write strtmp1
end sub
function gethttppage(url)
on error resume next
dim http
set http=server.createobject("microsoft.xmlhttp")
http.open "get",url,false
http.send()
if http.readystate<>4 then
exit function
end if
gethttppage=bytestobstr(http.responsebody,"gb2312")
set http=nothing
if err.number<>0 then
response.write "<p align=center>服务器获取文件内容出错,请稍后再试!!!</p>"
err.clear
end if
end function
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
'截取字符串,1.包括起始和终止字符,2.不包括
function strcut(strcontent,startstr,endstr,cuttype)
dim strhtml,s1,s2
strhtml = strcontent
on error resume next
select case cuttype
case 1
s1 = instr(strhtml,startstr)
s2 = instr(s1,strhtml,endstr)+len(endstr)
case 2
s1 = instr(strhtml,startstr)+len(startstr)
s2 = instr(s1,strhtml,endstr)
end select
if err then
strcute = "<p align='center'>没有找到需要的内容。</p>"
err.clear
exit function
else
strcut = mid(strhtml,s1,s2-s1)
end if
end function
'----------------------------
'取得当前脚本名称
'----------------------------
function getscript()
dim scriptaddress
scriptaddress = cstr(request.servervariables("script_name"))
getscript = scriptaddress
end function
%>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title> 天气预报 </title>
<meta http-equiv=content-type content=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: #f1f1f1 1px solid;
padding-right: 6px;
border-top: #f1f1f1 1px solid;
padding-left: 6px;
background: #f1f1f1;
padding-bottom: 2px;
border-left: #f1f1f1 1px solid;
cursor: hand;
padding-top: 2px;
border-bottom: #f1f1f1 1px solid;
}
.tb1 {
border-right: #999 1px solid;
padding-right: 6px;
border-top: #999 1px solid;
padding-left: 6px;
background: #ccc;
padding-bottom: 2px;
border-left: #999 1px solid;
cursor: hand;
padding-top: 2px;
border-bottom: #999 1px solid;
}
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height=3></td></tr>
</table>
<table bgcolor="#f1f1f1" align='center' width="760" cellspacing='1' cellpadding='3' style="border:1 solid #cccccc">
<tr align='center'>
<td class="tb0" nowrap onmouseleave="mhhover('tb0')" onmouseenter="mhhover('tb1')"><a href="<%=getscript()%>?1">华北地区</a></td>
<td class="tbsep">|</td>
<td class="tb0" nowrap onmouseleave="mhhover('tb0')" onmouseenter="mhhover('tb1')"><a href="<%=getscript()%>?2">华东地区</a></td>
<td class="tbsep">|</td>
<td class="tb0" nowrap onmouseleave="mhhover('tb0')" onmouseenter="mhhover('tb1')"><a href="<%=getscript()%>?3">华南地区</a></td>
<td class="tbsep">|</td>
<td class="tb0" nowrap onmouseleave="mhhover('tb0')" onmouseenter="mhhover('tb1')"><a href="<%=getscript()%>?4">华中地区</a></td>
<td class="tbsep">|</td>
<td class="tb0" nowrap onmouseleave="mhhover('tb0')" onmouseenter="mhhover('tb1')"><a href="<%=getscript()%>?5">东北地区</a></td>
<td class="tbsep">|</td>
<td class="tb0" nowrap onmouseleave="mhhover('tb0')" onmouseenter="mhhover('tb1')"><a href="<%=getscript()%>?6">西北地区</a></td>
<td class="tbsep">|</td>
<td class="tb0" nowrap onmouseleave="mhhover('tb0')" onmouseenter="mhhover('tb1')"><a href="<%=getscript()%>?7">西南地区</a></td>
<td class="tbsep">|</td>
<td class="tb0" nowrap onmouseleave="mhhover('tb0')" onmouseenter="mhhover('tb1')"><a href="<%=getscript()%>?8">港澳台地区</a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height=3></td></tr>
</table>
<script type=text/javascript>
<!--//
function sbar(st) {
st.style.backgroundcolor = "#f5f5f5";
}
function cbar(st) {
st.style.backgroundcolor = "#ffffff";
}
function mhhover(cls)
{
event.srcelement.classname = cls;
}
function mhclick(tbobj, cls)
{
event.srcelement.classname = cls;
}
//-->
</script>
<%
call getpage()
%>
<hr size='1' color='#cccccc' width='770' align='center'>
<div align='center'>copyright ©2005 <a href='http://www.bluespace.cn' target='_blank'>bluespace.cn</a></div>
</body>
</html>
上一篇: 藕夹是什么地方的菜品?如何把它做好吃呢?
下一篇: 一个asp快速字符串连接类