网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP实例
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.使用JScript.NET创建asp.net页面.
.用密码保护页面 (III).
.各种存储过程使用指南.
.用XMLHTTP做一个自己特色的Google .
.构建免受FSO组件威胁虚拟主机 .
.制作我们自己的Ebay(拍卖系统)(3).
.全文本检索的应用(2).
.用ASP技术编制隐藏用户密码程序.
.ASP进阶之文章在线管理更新(6).
.用ASP制作在线测试.
.下拉菜单输入,根据输入内容自动定.
.一个简单的网上书城的例子(四).
.利用ASP.NET设计FTP文件上传(下).
.ASP.NET发送ICQ信息DIY(1).
.制作我们自己的Ebay(拍卖系统)(5).
.无组件上传图片至SQLSERVER数据库.
.在ASP页里面注册DLL的VBScript C.
.用ASPJPEG组件制作图片的缩略图和.
.用asp解析图片地址,并将其保存。.
.一个BBS的源代码(二).

从新浪提取上海天气的vbs

发表日期:2001-11-23


起始很简单的。分析一下抓下来的代码,然后处理一下就行了。


'文件:weather.vbs 放入计划任务,每天早上8:30执行,生成饱含
'文件供首页使用
'执行方式:cscript D:\上海国家会计学院网站\内部社区\vbs\weather.vbs
'********************************************************************************************************
' Symantec ScriptBlocking Authenticated File
' E9815BB2-5813-400B-9ED5-156350335DE3

const incFilePath = "D:\上海国家会计学院网站\内部社区\web\club\" '包含文件所在目录,最后的\号是必须的
const logfile = "d:\club-job-log.txt" '日志文件
const incWeather = "weather-report.asp" '包含文件所在目录,最后的\号是必须的
dim fs
dim f
on error resume next

Set fs = CreateObject("Scripting.FileSystemObject")
dim wstr
wstr=getHTTPPage("http://sh.sina.com.cn/")
'Response.Write wstr

if instr(wstr,"<img src=images/sina_sh/new/sh24.gif width=172 height=17>")>0 then
wstr=mid(wstr,instr(wstr,"<img src=images/sina_sh/new/sh24.gif width=172 height=17>")+len("<img src=images/sina_sh/new/sh24.gif width=172 height=17>"))
wstr=mid(wstr,instr(wstr,"<table width=160 border=0 cellspacing=0 cellpadding=0>"))
wstr=mid(wstr,1,instr(wstr,"</table>")+len("</table>"))
end if
wstr=replace(wstr,"<tr><td colspan=3 align=right><a href=http://weather.sina.com.cn/>其他城市</a><font color=#015B7B>>></font></td></tr>","")
dim pos1,pos2
pos1=instr(wstr,"<tr>")
pos2=instr(pos1,wstr,"</tr>")
wstr=right(wstr,len(wstr)-pos2-4-4)
wstr=replace(wstr,"</table>","")
wstr=replace(wstr,"width=35","")
wstr=replace(wstr,"width=45","")
wstr=replace(wstr,"width=60","")
'Response.Write wstr
if err.number=0 then
Set f = fs.CreateTextFile(incFilePath & incWeather,true)
f.write wstr
set f = nothing
else
wscript.echo err.description
end if
set fs = nothing

Sub writeLog(Msg)
On Error Resume Next
Dim f
Set f = fs.OpenTextFile(logfile,8,true)
f.WriteLine now & " - " & Msg
f.close
End Sub

function getHTTPPage(url)
on error resume next
dim http
set http=createobject("MSXML2.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


'***********************************************
'

上一篇:精彩OUTLOOK 2000组件放送 人气:11948
下一篇:列出服务器上的打印机  人气:11805
浏览全部的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐