<%Function Bytes2bStr(vin,cSet) Dim BytesStream,StringReturn Set BytesStream = Server.CreateObject("ADODB.Stream") BytesStream.Type = 2 BytesStream.Open BytesStream.WriteText vin BytesStream.Position = 0 BytesStream.CharSet = cSet BytesStream.Position = 2 StringReturn =BytesStream.ReadText BytesStream.close Set BytesStream = Nothing Bytes2bStr = StringReturnEnd Function
Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")m_queryURL = "http://www.microsoft.com/china/technet/security/current.mspx"XMLHTTP.Open "GET", m_queryURL, falseXMLHTTP.send()s = XMLHTTP.responseBodyaa = Bytes2bStr(s,"GB2312")
Set re = New RegExpre.Pattern = "<span class=""label"">.*?<//span>"re.Global = Truere.IgnoreCase = truere.MultiLine = falseset matches = re.Execute(aa)dim tmptmp = ""for each match in matches tmp = tmp&match.valuenexttmp = Replace(tmp,"href=""","target=_blank href=""http://www.microsoft.com")
set fso = server.CreateObject("scripting.filesystemobject")set f = fso.OpenTextFile(server.mappath("Microsoft.html"),2,true)f.write(tmp)f.closeset fso = nothing
response.Redirect "Microsoft.html"%>