<td width="2%" align="center" valign="center" style="border:1px #FF6317 solid;word-break:break-all" bgcolor="#FCAA78">天气预报</td>
<td width="35%" align="left" style="padding-left:10">
<%
strURL ="http://weather.sina.com.cn/iframe/weather/430101_w.html"'长沙
HtmlURL=getHTTPPage(strURL)
dim match,matches,n,strArr(7)
set matches = dealHTML(HtmlURL)
n = 0
For each match in matches
if match.length > 2 then
strArr(n) = match.value
n = n + 1
end if
Next
response.write("<font color='#FF9562' size='3'><b>" & strArr(1) & strArr(4) & _
"</b></font><br><br><font color='#336699' size='3'>" & replace(strArr(2),"-","转") & _" " & strArr(3) & "<br>" & strArr(5) & " " & strArr(6) & _ "<br>" & strArr(7) & "</font>")
%>
</td>
上面是取天气预报的内容,楼主如果需要成一行的话,把上面这一段的"<br>"标签取消既可。
下面是两个需要被上面代码调用的函数。
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 FunctionFunction dealHTML(s)
Dim re,ars,match,matchs
Set re = new RegExp 
re.IgnoreCase = True 
re.Global = True 
re.Pattern="\<html\>[\s\S]*?\<body.*?\>" '从<html>到<body>之间的所有空白和非空白字符(所有字符)
s=re.Replace(s,"")
re.Pattern = "(<.*?>)|(-->)|([ \t])"
s = re.Replace(s,"")
re.pattern = ".*?\n"
set dealHTML = re.execute(s)
set re = Nothing
End Function