BytesToBstr获取的源码转换为中文的代码
程序员文章站
2022-04-14 20:22:29
'================================================== '函数名:bytestobstr '作 用:将...
'==================================================
'函数名:bytestobstr
'作 用:将获取的源码转换为中文
'参 数:body ------要转换的变量
'参 数:cset ------要转换的类型
'==================================================
function 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.readtext
objstream.close
set objstream = nothing
end function
'函数名:bytestobstr
'作 用:将获取的源码转换为中文
'参 数:body ------要转换的变量
'参 数:cset ------要转换的类型
'==================================================
function 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.readtext
objstream.close
set objstream = nothing
end function