会新闻小偷程序的进来,高分请教!

klark 2004-02-09 10:58:48
新闻来源页面:
http://www.jxmu.edu.cn/news/news.jsp
我的偷新闻程序如下:
<%
on error resume next
Server.ScriptTimeOut=120 '设定操作超时的时间(因为程序运行速度慢啊)
url = "http://www.jxmu.edu.cn/news/news.jsp" '新闻来源的页面
wstr = getHTTPPage(url) '取得页面内容
if err.number=0 then '如果获取成功
start=newstring(wstr,"<td width=""74%"" height=""25"" align=""left"" background=""images/line-3.gif"">") '要获取的内容在网页中的开始位置(通过唯一的标志寻找)
over=newstring(wstr,"</font> </li></td>") '要获取的内容在网页中结束位置(通过唯一的标志寻找)
wstr=mid(wstr,start,over-start) '获取想要的内容
wstr=replace(wstr,"<a href=""news1.jsp","<a href=""http://www.jxmu.edu.cn/news/news1.jsp")'替换掉你不想要的内容
end if
response.write wstr '输出
%>


以下是不需要改的自定义函数程序:

<%
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=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function

Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function

Function NewString(wstr,strng)
NewString=Instr(wstr,strng)
End Function
%>

结果却只显示了一条新闻,(效果见http://www.yd.jxmu.edu.cn/newyd/yd/homepage/1.asp)
我想添加一个循环控制,但是不知道怎么加,哪个高手知道怎么改我的程序?
...全文
108 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
man2004 2004-07-26
  • 打赏
  • 举报
回复
:)

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧