<%
'Nama: Asp General Collection Function Versi Redundan, Mereka yang ingin memodifikasi versi berkualitas tinggi itu sendiri
'Penulis: Liu Yongfa
'Tanggal: 2007-6-23
FunctionGetHttppage (path)
t = getbody (jalur)
getHttppage = bytestoBstr (t, "gb2312")
Fungsi endfungsi
FunctionGody (URL)
OnerrorresumeNext
Setxmlhttp = createObject ("microsoft.xmlhttp")
Denganxmlhttp
.Open "get", url, false, "", ""
.Mengirim
.WaitForResponse1000
Getbody = .responseBody
Endwith
Setxmlhttp = tidak ada
Fungsi endfungsi
FunctionByTestObstr (body, cset)
OnerrorresumeNext
Dimobjstream
SetoBjStream = server.CreateObject ("adodb.stream")
objstream.type = 1
objstream.mode = 3
objstream.open
objstream.writeBody
objstream.position = 0
objstream.type = 2
objstream.charset = cset
BytestoBstr = objstream.readtext
objstream.close
Setobjstream = tidak ada
Fungsi endfungsi
FunctionGetHttpimg (url)
OnerrorresumeNext
Dimxmlhttp
Setxmlhttp = server.CreateObject ("msxml2.xmlhttp")
xmlhttp.open "get", url, false
xmlhttp.send ()
Ifxmlhttp.status <> 200thenexitfunction
getHttpimg = xmlhttp.responseBody
Setxmlhttp = tidak ada
Iferr.number <> 0thenerr.clear
Fungsi endfungsi
FunctionsAve2local (dari, tofile)
DimgetUrl, objstream, imgs
getUrl = trim (dari)
imgs = getHttpimg (getUrl)
SetoBjStream = server.CreateObject ("adodb.stream")
objstream.type = 1
objstream.open
objstream.writeimgs
objstream.savetofiletofile, 2