用asp获取微软安全更新列表的代码 小偷程序
程序员文章站
2022-08-05 21:47:25
复制代码 代码如下:<% function bytes2bstr(vin,cset) dim bytesstream,stringreturn set bytesst...
复制代码 代码如下:
<%
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"
%>
上一篇: 小程序记录
下一篇: NET 实例化泛形对象并赋值