Copy codeThe Code is as follows: <%
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 = StringReturn
End Function
Set xmlhttp = server. CreateObject ("Msxml2.XMLHTTP ")
M_queryURL = "http://www.microsoft.com/china/technet/security/current.mspx"
XMLHTTP. Open "GET", m_queryURL, false
XMLHTTP. send ()
S = XMLHTTP. responseBody
Aa = Bytes2bStr (s, "GB2312 ")
Set re = New RegExp
Re. Pattern = "<span class =" "label" "> .*? <\/Span>"
Re. Global = True
Re. IgnoreCase = true
Re. MultiLine = false
Set matches = re. Execute (aa)
Dim tmp
Tmp = ""
For each match in matches
Tmp = tmp & match. value
Next
Tmp = 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. close
Set fso = nothing
Response. Redirect "Microsoft.html"
%>