在线用户    站点地图 技术论坛 文档中心 站点导航 资源下载 语言参考 教程专题 站点统计 业务项目 使用帮助
您的位置
MSDN参考新加了CSS2参考,全中文,制作精良。245k下载。           新加了sxf_sxf推荐的"动态网页专家指导" 下载!          新加了lsg2002lsg推荐的"ASP.NET高级编程(PDF)" 下载!          新加了DHTML代码预览!!,功能强大哦!欢迎试用          新加了网友lincong为大家提供的SQL Server 2000 程序员指南,有点大,但同时也就说明内容全咯!           新加了网友ibra为大家提供的北大的JAVA课件,很适合初学者入门           新加了一个java的连接缓冲池代码示例           新加了人月神话电子版下载!软件工程巨著哦~~           更新了评分标准,引入了“专家分”概念,相信可以更好的激励大家的学习!详情请看“使用帮助”           新加了由网友GGG提供的“IIS超级管理手册”,值得一看哦!(虽然我没看过 :P )           新加了“英雄榜”,欢迎测试!           “无组件上传·从原理剖析到实践”已经全部完成,源码全部开放,有兴趣的朋友请到文档中心一探究竟。  您的位置  首页>技术论坛>ASP>F0058485 在同一窗口中打开页面中的链接 在新窗口中打开页面中的链接 将ASPCHINA设为首页 将ASPCHINA加入书签    
 LOGIN HERE
用户:
密码: 忘记密码
记住密码 用户注册 游客进入

论坛首页
|--web开发
   |--ASP
   |--JSP
   |--ASP.net
   |--DHTML
   |--RUBY
|--软件开发
   |--C++
      |--Code here
   |--JAVA
   |--VB
   |--Delphi
   |--XML
|--.net技术
   |--C#
   |--VB.net
|--Yup开发组
|--站务&投诉
   |--站长专区
|--硬件&网络
|--休息室
|--数据库技术
 进入精华区 我要发言



 一个实时天气预报系统(央视版)back to ASP forum  
作者:bluexue,7级分数:0
日期:2003/4/11 7:44:00类别:ASP, 技术问题
回复:3次浏览:1614次
状态:无分贴

<%

  '===================================================================
  '|                                                                  |
  '|                  即时天气预报系统v.96版                          |
  '|                      程序制作:天 机(webmaster@jmcity.com)      |
  '|                      程序修改:waiting(niaiwoya@21cn.com)      |
  '|                    此软件为免费软件                            |
  '|                  The software is free                          |
  '|          此版不需要sfo支持,直接调用weather.asp即可            |
  '|        首页调用方法 <script src=weather.asp></script>就可调用    |
  '|      注意:虽然此软件是免费的,但还是希望使用者不要修改版权信息  |
  '===================================================================

url="http://www.cctv.com/weather/city_china.js"
TakenHTML = GetURL(url)
Response.Flush
'on error resume next
Function GetURL(url)
    Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
          With Retrieval
          .Open "POST", url, False, "", ""
          .Send
          GetURL = .responseBody
          End With
    Set Retrieval = Nothing
End Function
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
msg=  bytes2BSTR(TakenHTML)
dim i
for i=1 to 46
msg=replace(msg,"cw["&i&"]=new today_weather","")
next
tq=""
msg=trim(replace(msg,"'",""))
msg=split(msg,";")
ff=msg(0)
for j=lbound(msg)+2 to ubound(msg)-1
msg(j)= mid(msg(j),4,len(msg(j))-4)
dim msg1
msg1=split(msg(j),",")
js(msg1(3))
tqmsg=tqmsg&" <font color=red>"&msg1(0)&"</font>:"&tq &msg1(5)&"到"&msg1(4)&" "&_
      msg1(6)&" "
next
ff=replace(ff,"var datestring=中央气象台城市天气预报:","")
ff="Access设计在线天气预报:"&ff
msg2="<div align=center>" &_
    "<marquee scrollamount=4 border=1 scrolldelay=80 width=90% height=15" &_
    " onmouseover=\'this.stop()\' onclick=top.location.href='\weather.asp\'" &_
    " onmouseout=\'this.start()\'>"&ff&" "&tqmsg&"</marquee></div>"
msg2=replace(msg2,"images/","http://www.cctv.com/weather/images/")
msg2="document.write("""&msg2&""");"
response.write msg2
function js(str)
select case str
case 1
tq="晴"
tq=tq&"  <img src=images/sun.gif> "
case 2
tq="多云"
tq=tq&" <img src=images/yun.gif> "
case 3
tq="小雨"
tq=tq&" <img src=images/yu.gif> "
case 4
tq="晴转多云"
tq=tq&" <img src=images/yun.gif> "
case 5
tq="风"
tq=tq&" <img src=images/feng.gif> "
case 6
tq="小雪"
tq=tq&" <img src=images/xue.gif> "
case 7
tq="小雨转多云"
tq=tq&" <img src=images/yu.gif> "
case 8
tq="阴转多云"
tq=tq&" <img src=images/yin.gif> "
case 9
tq="多云转晴"
tq=tq&" <img src=images/yun.gif> "
case 10
tq="中雨转阴"
tq=tq&" <img src=images/yu.gif> "
case 11
tq="小雪转多云"
tq=tq&" <img src=images/xue.gif> "
case 12
tq="晴转雾"
tq=tq&" <img src=images/sun.gif> "
case 13
tq="阴"
tq=tq&" <img src=images/yin.gif> "
case 14
tq="小雨转阴"
tq=tq&" <img src=images/yu.gif> "
case 15
tq="中雨"
tq=tq&" <img src=images/yu.gif> "
case 16
tq="多云转小雪"
tq=tq&" <img src=images/xue.gif> "
case 17
tq="多云转阴"
tq=tq&" <img src=images/yin.gif> "
case 18
tq="小雪转阴"
tq=tq&" <img src=images/xue.gif> "
case 19
tq="雾"
tq=tq&" <img src=images/wu.gif> "
case 20
tq="大雾"
tq=tq&" <img src=images/wu.gif> "
case 21
tq="小雨转雨夹雪"
tq=tq&" <img src=images/xue.gif> "
case 22
tq="雨夹雪"
tq=tq&" <img src=images/xue.gif> "
case 23
tq="多云转小雨"
tq=tq&" <img src=images/yu.gif> "
case 24
tq="阴转小雪"
tq=tq&" <img src=images/xue.gif> "
case 25
tq="阴转小雨"
tq=tq&" <img src=images/yu.gif> "
case 26
tq="中雨转小雨"
tq=tq&" <img src=images/yu.gif> "
case 27
tq="阵雪转小雨"
tq=tq&" <img src=images/yu.gif> "
case 28
tq="雨夹雪转小雨"
tq=tq&" <img src=images/xue.gif> "
case 29
tq="阴转晴"
tq=tq&" <img src=images/sun.gif> "
case 30
tq="雨夹雪转多云"
tq=tq&" <img src=images/xue.gif> "
case 31
tq="雷阵雨"
tq=tq&" <img src=images/yu.gif> "
case 32
tq="雨夹雪"
tq=tq&" <img src=images/xue.gif> "
case 33
tq="多云转阵雪"
tq=tq&" <img src=images/xue.gif> "
case 34
tq="雾转多云"
tq=tq&" <img src=images/yun.gif> "
case 35
tq="晴转阴"
tq=tq&" <img src=images/yin.gif> "
case 36
tq="雾转晴"
tq=tq&" <img src=images/sun.gif> "
case 37
tq="雾转小雨"
tq=tq&" <img src=images/yu.gif> "
case 38
tq="晴转小雨"
tq=tq&" <img src=images/yu.gif> "
case 39
tq="小雨转中雨"
tq=tq&" <img src=images/yu.gif> "
case 40
tq="多云转雾"
tq=tq&" <img src=images/yun.gif> "
case 41
tq="中雪转小雪"
tq=tq&" <img src=images/xue.gif> "
case 42
tq="大雪转小雪"
tq=tq&" <img src=images/xue.gif> "
case 43
tq="阵雪转晴"
tq=tq&" <img src=images/xue.gif> "
case 44
tq="晴转小雪"
tq=tq&" <img src=images/xue.gif> "
case 45
tq="大雨"
tq=tq&" <img src=images/yu.gif> "
case 46
tq="多云转雷阵雨"
tq=tq&" <img src=images/yu.gif> "
case 47
tq="雾转阴"
tq=tq&" <img src=images/yin.gif> "
case 48
tq="多云转雨夹雪"
tq=tq&" <img src=images/xue.gif> "
case 49
tq="阵雪转中雪"
tq=tq&" <img src=images/xue.gif> "
case 50
tq="阴转雨夹雪"
tq=tq&" <img src=images/xue.gif> "
case 51
tq="雾转雨夹雪"
tq=tq&" <img src=images/xue.gif> "
case 52
tq="小雪转大雪"
tq=tq&" <img src=images/xue.gif> "
case 53
tq="中雪"
tq=tq&" <img src=images/xue.gif> "
case 54
tq="大雪转中雪"
tq=tq&" <img src=images/xue.gif> "
case 55
tq="雷阵雨转多云"
tq=tq&" <img src=images/yun.gif> "
case 56
tq="小雪转晴"
tq=tq&" <img src=images/sun.gif> "
case 57
tq="阴转阵雪"
tq=tq&" <img src=images/sun.gif> "
case 58
tq="阵雪转多云"
tq=tq&" <img src=images/xue.gif> "
case 59
tq="雨夹雪转中雪"
tq=tq&" <img src=images/xue.gif> "
case 60
tq="中雨转大雨"
tq=tq&" <img src=images/yu.gif> "
case 61
tq="阴转中雪"
tq=tq&" <img src=images/xue.gif> "
case 62
tq="多云转中雪"
tq=tq&" <img src=images/xue.gif> "
case 63
tq="小雨转大雪"
tq=tq&" <img src=images/xue.gif> "
case 64
tq="小雨转大雨"
tq=tq&" <img src=images/yu.gif> "
case 65
tq="中雨转中雪"
tq=tq&" <img src=images/xue.gif> "
case 66
tq="小雨转大雨"
tq=tq&" <img src=images/yu.gif> "
case 67
tq="阵雪"
tq=tq&" <img src=images/xue.gif> "
case 68
tq="小雪转中雪"
tq=tq&" <img src=images/xue.gif> "
case 69
tq="大雨转小雨"
tq=tq&" <img src=images/yu.gif> "
case 70
tq="雨夹雪转大雪"
tq=tq&" <img src=images/xue.gif> "
case 71
tq="大雨转中雨"
tq=tq&" <img src=images/yu.gif> "
case 72
tq="中雪转多云"
tq=tq&" <img src=images/xue.gif> "
case 73
tq="中雨转大雪"
tq=tq&" <img src=images/xue.gif> "
case 74
tq="中雨转雨夹雪"
tq=tq&" <img src=images/xue.gif> "
case 75
tq="小雨转晴"
tq=tq&" <img src=images/yu.gif> "
case 76
tq="中雪转阴"
tq=tq&" <img src=images/xue.gif> "
case 77
tq="阴转中雨"
tq=tq&" <img src=images/yu.gif> "
case 78
tq="雾转小雪"
tq=tq&" <img src=images/xue.gif> "
case 79
tq="冻雨转小雨"
tq=tq&" <img src=images/yu.gif> "
case 80
tq="雨夹雪转阴"
tq=tq&" <img src=images/yu.gif> "
case 81
tq="晴转雨夹雪"
tq=tq&" <img src=images/xue.gif> "
case 82
tq="冻雨转阴"
tq=tq&" <img src=images/yin.gif> "
case 83
tq="小雪转雾"
tq=tq&" <img src=images/xue.gif> "
case 84
tq="雨夹雪转雾"
tq=tq&" <img src=images/xue.gif> "
case 85
tq="大雪"
tq=tq&" <img src=images/xue.gif> "
case 86
tq="阵雪转阴"
tq=tq&" <img src=images/xue.gif> "
case 87
tq="阴转雾"
tq=tq&" <img src=images/yin.gif> "
case 88
tq="雨夹雪转小雪"
tq=tq&" <img src=images/xue.gif> "
case 89
tq="中雨转小雪"
tq=tq&" <img src=images/yu.gif> "
case 90
tq="雷阵雨转晴"
tq=tq&" <img src=images/yu.gif> "
case 91
tq="雾转中雨"
tq=tq&" <img src=images/wu.gif> "
case 92
tq="多云转雷阵雨"
tq=tq&" <img src=images/yun.gif> "
case 93
tq="雷阵雨转大雨"
tq=tq&" <img src=images/yu.gif> "
case 94
tq="雷阵雨转阴"
tq=tq&" <img src=images/yu.gif> "
case 95
tq="雷阵雨转小雨"
tq=tq&" <img src=images/yu.gif> "
case 96
tq="雷阵雨转阴"
tq=tq&" <img src=images/yu.gif> "
case 97
tq="雷阵雨转阴"
tq=tq&" <img src=images/yu.gif> "
case 98
tq="雨夹雪转晴"
tq=tq&" <img src=images/xue.gif> "
case 99
tq="小雨转雾"
tq=tq&" <img src=images/yu.gif> "
case 100
tq="中雪转大雪"
tq=tq&" <img src=images/xue.gif> "
case 101
tq="中雪转阵雪"
tq=tq&" <img src=images/xue.gif> "
case 102
tq="小雨转中雪"
tq=tq&" <img src=images/xue.gif> "
case 103
tq="大雪转多云"
tq=tq&" <img src=images/xue.gif> "
case 104
tq="阴转雷阵雨"
tq=tq&" <img src=images/yu.gif> "
case 105
tq="小雨转雷阵雨"
tq=tq&" <img src=images/yu.gif> "
case 106
tq="暴雪转中雪"
tq=tq&" <img src=images/xue.gif> "
case 107
tq="小雪转阵雪"
tq=tq&" <img src=images/xue.gif> "
case 108
tq="雷阵雨转中雨"
tq=tq&" <img src=images/yu.gif> "
case 109
tq="多云转中雨"
tq=tq&" <img src=images/yu.gif> "
case 110
tq="雷阵雨转暴雨"
tq=tq&" <img src=images/yu.gif> "
case 111
tq="暴雨转大雨"
tq=tq&" <img src=images/yu.gif> "
case 112
tq="暴雨"
tq=tq&" <img src=images/yu.gif> "
case 113
tq="小雨转暴雨"
tq=tq&" <img src=images/yu.gif> "
case 114
tq="多云转大雨"
tq=tq&" <img src=images/yu.gif> "
case 115
tq="暴雨转小雨"
tq=tq&" <img src=images/yu.gif> "
case 116
tq="暴雨转中雨"
tq=tq&" <img src=images/yu.gif> "
case 117
tq="中雨转暴雨"
tq=tq&" <img src=images/yu.gif> "
case 118
tq="中雨转多云"
tq=tq&" <img src=images/yu.gif> "
case 119
tq="阴转暴雨"
tq=tq&" <img src=images/yu.gif> "
case 120
tq="大雨转暴雨"
tq=tq&" <img src=images/yu.gif> "
case 121
tq="暴雨转雷阵雨"
tq=tq&" <img src=images/yu.gif> "
case 122
tq="大暴雨转暴雨"
tq=tq&" <img src=images/yu.gif> "
case 123
tq="暴雨转多云"
tq=tq&" <img src=images/yu.gif> "
case 124
tq="中雨转雷阵雨"
tq=tq&" <img src=images/yu.gif> "
case 125
tq="大雨转多云"
tq=tq&" <img src=images/yu.gif> "
case 126
tq="暴雨转大暴雨"
tq=tq&" <img src=images/yu.gif> "
case 127
tq="大雨转雷阵雨"
tq=tq&" <img src=images/yu.gif> "
case 128
tq="雾转雷阵雨"
tq=tq&" <img src=images/yu.gif> "
case 129
tq="大雨转阴"
tq=tq&" <img src=images/yu.gif> "
case 130
tq="雾转暴雨"
tq=tq&" <img src=images/yu.gif> "
case 131
tq="中雪转小雨"
tq=tq&" <img src=images/yu.gif> "
case 132
tq="小雨转小雪"
tq=tq&" <img src=images/xue.gif> "
case 133
tq="中雪转晴"
tq=tq&" <img src=images/xue.gif> "
case 134
tq="多云转大雪"
tq=tq&" <img src=images/xue.gif> "
case 135
tq="小雨转冻雨"
tq=tq&" <img src=images/yu.gif> "
case 136
tq="晴转阵雪"
tq=tq&" <img src=images/sun.gif> "
case 137
tq="冻雨转雨夹雪"
tq=tq&" <img src=images/yu.gif> "
case 138
tq="阵雪转小雪"
tq=tq&" <img src=images/yu.gif> "
case 139
tq="阴转大雪"
tq=tq&" <img src=images/xue.gif> "
case 140
tq="小雪转雨夹雪"
tq=tq&" <img src=images/xue.gif> "
end select
end function
%>


哪位可以详细的注释一下这个程序,大家都了解一下

reply[F0058485]
 



 
 re [1] 一个实时天气预报系统(央视版)ASP forum  
- miles03-04-11 10:26  

这个程序主要就是字符串拆分。前面用了Microsoft.XMLHTTP来得到网页源码,然后,就是字符串的分析。最后一段,是根据天气显示不同的图片。

如果对字符串分析不是很清楚,你可以看看vbs参考,以及文档中心的“无组件上传”。

good luck!

reply[F0058520]
 



 
 这个系统是"实时"的吗ASP forum  
- bluexue03-04-12 06:48  

.....

reply[F0058773]
 



 
 re [1] 这个系统是"实时"的吗ASP forum  
- miles03-04-17 16:31  

是的。是即时读取数据的。

reply[F0059716]
 



您的位置
  (c)2000-2019 Yup Studio, all rights reserved.  
498.0469