- 热门文章:
- · 一段自动补位的函数(ASP)
- · VBS 中 Space 函数的应用
- · 游走于ASP与ASP.NET的郁闷
- · 用ASP的安全验证来对windows 2000的管理者密码进行在线修改
- · ADSI,使用ASP来完成NT管理
- · 被ASP的小问题难倒!
- · 域名查询系统--适合新手
- · asp模块化分页
- · ASP分页显示详论
- · Iframe高度自适应
- · 正则表达式大全
- · WMI学习
上一篇:InStrRev 函数 >>
新写的一个定时新闻小偷
系统要求:
支持FSO
服务器UDP TCP/IP 没有屏蔽
下面是小偷的内容
FileName TianQi.asp
Write By Niaoked QQ408611119
<%
if hour(now)=9 and minute(now)<30 then
getCategories()
end if
Function getCategories()
on error resume next
Dim oXMLHTTP ‘’ As Object
Dim oCategories ‘’ As Object
Dim BodyText
Dim Pos,Pos1
Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
‘’--- set the XMLHTTP call and issue send (no parm as category
‘’--- is included in URL
oXMLHTTP.open "GET","http://weather.china.com.cn/travel_gntq.php?cityid=56196&cityname=绵阳",False ‘’这个地方换成你自己的地址
oXMLHTTP.send
‘’--- load the response into the Categories data island
BodyText=oXMLHTTP.responsebody
BodyText=BytesToBstr(BodyText,"gb2312")
Pos=Instr(BodyText,"<body")
pos1=Instr(BodyText,"</body>")
BodyText=mid(BodyText,pos,pos1)
BodyText=split(BodyText,"<table")
Pos=Instr(BodyText(4),"<tr")
pos1=Instr(BodyText(4),"</tr>")
Body=mid(BodyText(4),pos,len(BodyText(4))-pos)
body=split(body,"</table>")
body1=split(replace(replace(replace(body(0),"<br>",""),"</td>",""),"</tr>",""),"天气")
for i= 1 to ubound(body1)
body3=split(body1(i),"<td")
weather=weather & "document.write("""& i&"$" & "天气" & HTMLEncode(trim(body3(0))) & """);" & vbcrlf
next
weather=replace(weather,"1$","<FONT color=#ffffff>【今天】</FONT>")
weather=replace(weather,"2$","<FONT color=#ffffff>【明天】</FONT>")
weather=replace(weather,"3$","<FONT color=#ffffff>【后天】</FONT>")
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.CreateTextFile(request.ServerVariables("APPL_PHYSICAL_PATH")& "tq.js", True)
f.write("document.write(‘’绵阳天气预报:‘’);" &vbcrlf & replace(weather,"<BR>",""))
f.close
Set f = nothing
Set fs = nothing
response.write "绵阳天气预报:"& weather
Set oXMLHTTP = Nothing
if err.number<>0 then
response.write "出错了,错误描述:"&err.description & "<br>错误来源"& err.source
response.End()
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
Public Function HTMLEncode(fString)
If Not IsNull(fString) Then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ") ‘’
fString = Replace(fString, CHR(9), " ") ‘’
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'") ‘’单引号过滤
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")
HTMLEncode = fString
End If
End Function
%>
下一篇:一段自动补位的函数(ASP) >>
相关文章:
- · Session 详解
- · 关于交叉报表的动态实现
- · 页面执行需要长时间时向用户的提示信息
- · 使用Repeater模板 二
- · Sucess On a Horse
- · 校友通讯资料管理系统(1)
- · ASP实现图片上存
- · 提高网站在搜索引擎中的排名
- · 关于无组上传的老话题
- · 如何实现图片的随机生成与显示
- · 怎么把webapplication打包成安装文件
- · 为treeview添加客户端事件
- · 如何让不同的语言版本显示正确的中文?
- · 线程的处理(2)
- · 线程的处理(1)
- · 再谈ASP防止SQL Injection漏洞的问题
- · 用asp编写文档搜索页面
- · ASP中使用SQL语句
- · 利用反射动态调用类成员
- · Asp.net组件设计浅论
- · 越过调试这道槛——ASP.NET无法调试问题剖析
- · 一段用ASP查看ASP文件源码的程序.
- · ASP显示在线人数
- · Asp.net多页面间保留状态
- · 简单ASP计数器
- · 使用 HttpContext.RewritePath 来配合 Server.Transfer/Execute
- · SQLSERVER扩展存储过程XP_CMDSHELL的简单应用
- · SQL Server 存储过程的分页
- · 经典的asp整理
- · Access中分组统计的实例
- · 一段分页程序实例代码!
- · 从asp到asp.net之快速转型
- · ASP升级程序
- · 利用WebClient类向服务器上载文件
- · .net中Web自定义控件编写的几个注意事项
- · 奇妙的.NET之Web程序中使用windows弹出框
- · webservice.htc无法传递中文数据的解决
- · 用反射调用别人的.NET程序里的类和方法
