您现在的位置是:网站首页> 编程资料编程资料

蓝色空间 天气小偷_小偷/采集_

2023-05-25 169人已围观

简介 蓝色空间 天气小偷_小偷/采集_

复制代码 代码如下:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'------------------------------
'程序名称:蓝色空间 天气小偷
'程序设计:小马
'QQ:55100100
'网站:http://www.bluespace.cn(蓝色空间)
'日期:2005-11-15
'------------------------------
Dim strArray(9,2),AreaID
strArray(1,0) = "index.htm"
strArray(1,1) = "华北地区"
strArray(2,0) = "hd.htm"
strArray(2,1) = "华东地区"
strArray(3,0) = "hn.htm"
strArray(3,1) = "华南地区"
strArray(4,0) = "hz.htm"
strArray(4,1) = "华中地区"
strArray(5,0) = "db.htm"
strArray(5,1) = "东北地区"
strArray(6,0) = "xb.htm"
strArray(6,1) = "西北地区"
strArray(7,0) = "xn.htm"
strArray(7,1) = "西南地区"
strArray(8,0) = "ga.htm"
strArray(8,1) = "港澳台地区"
AreaID = Request.QueryString
If AreaID = "" Then AreaID = 1

Sub GetPage()
    Dim strUrl,strTmp,strTmp1


    strUrl = "http://weather.265.com/"&strArray(AreaID,0)

    strTmp = GetHttpPage(strUrl)

    strTmp1 = strCut(strTmp,"","",2)
    strTmp1 = ""&strTmp1
    strTmp1 = Replace(strTmp1,"width=""750""","width='760' align='center'")
    strTmp1 = Replace(strTmp1,"bgcolor=""4952BC""","bgcolor='#cccccc'")
    strTmp1 = Replace(strTmp1,"bgcolor=""#e4f0f8""","bgcolor='#ffffff' onmouseover=""sbar(this)"" onmouseout=""cbar(this)""")
    strTmp1 = ""&vbCrLf&strTmp1

    Response.Write strTmp1
End Sub

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=bytesToBSTR(Http.responseBody,"GB2312")
    set http=nothing
    If Err.number<>0 then 
        Response.Write "服务器获取文件内容出错,请稍后再试!!!


        Err.Clear
    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

'截取字符串,1.包括起始和终止字符,2.不包括
Function strCut(strContent,StartStr,EndStr,CutType)
    Dim strHtml,S1,S2
    strHtml = strContent
    On Error Resume Next
    Select Case CutType
    Case 1
        S1 = InStr(strHtml,StartStr)
        S2 = InStr(S1,strHtml,EndStr)+Len(EndStr)
    Case 2
        S1 = InStr(strHtml,StartStr)+Len(StartStr)
        S2 = InStr(S1,strHtml,EndStr)
    End Select
    If Err Then
        strCute = "没有找到需要的内容。

"
        Err.Clear
        Exit Function
    Else
        strCut = Mid(strHtml,S1,S2-S1)
    End If
End Function

'----------------------------
'取得当前脚本名称
'----------------------------
Function GetScript()
    Dim ScriptAddress
    ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME"))
    GetScript = ScriptAddress
End Function
%>



 天气预报 





 



?1">华北地区
|
?2">华东地区
|
?3">华南地区
|
?4">华中地区
|
?5">东北地区
|
?6">西北地区
|
?7">西南地区
|
?8">港澳台地区



 




<%
Call GetPage()
%>

Copyright ©2005 BlueSpace.CN




相关内容

-六神源码网