gethttppage(url) 如何用UTF
1个回答
展开全部
http.open "GET",url,false
http.send()
if http.readystate<>4 then
exit functionend ifgetHTTPPage=BytesToBstr(http.responsebody,"utf-8")
call writetotextfile("../static_view/"&strFolder&"/"&year(rs("ntime"))&month(rs("ntime"))&day(rs("ntime"))&rs("id")&".html",getHTTPPage,"utf-8")
set http=nothing
if err.number<>0 thenerr.Clearend ifend function
function writetotextfile(fileurl,str,cset)
set stm=server.CreateObject("adodb.stream")stm.type=2stm.mode=3stm.charset=csetstm.openstm.writetext str
stm.savetofile server.MapPath(fileurl),2
stm.flushstm.closeset stm=nothing
end functionFunction 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.ReadTextobjstream.Close
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询