news2.asp

来自「自由领域ASP+WAP同学录(V1.0)系统是一套仿ChinaRen的即可用电脑」· ASP 代码 · 共 35 行

ASP
35
字号
<% 
Function bytes2BSTR(vIn) 
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 
sub show
Url = "http://dailynews.sina.com.cn/news1000.shtml" 
set oSend=createobject("Microsoft.XMLHTTP") 
SourceCode = oSend.open ("GET",url,false) 
oSend.send() 
SourceCode = bytes2BSTR(oSend.responseBody) 
betw=instr(SourceCode,"<!--新闻结束-->")-instr(SourceCode,"<li>") 
first=instr(SourceCode,"<li>") 
SourceCode = Mid(SourceCode,first,betw) 
SourceCode = split(SourceCode,"<li>")
for i=1 to 10  ' 这里修改需要显示新闻的数目
sss = split(SourceCode(i),">")
SourceCodecon=left(sss(1),int(len(sss(1)))-3)
SourceCodelink=mid(sss(0),15,len(sss(0))-29)
response.write "<li><a href='disp.asp?url="&SourceCodelink&"&topic="&SourceCodecon&"'>"&SourceCodecon&"</a>"
next
end sub
%> 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?