asp读取utf-8文件信息的ReadFromTextFile函数

作者:网络 来源:佚名 更新时间:2009-01-20 21:36:30 点击:

以下是引用片段:
function readfromtextfile(fileurl,charset)
       dim str
       set stm=server.createobject("adodb.stream")
       stm.type=2
       stm.mode=3 
       stm.charset=charset
       stm.open
       stm.loadfromfile server.mappath(fileurl)
       str=stm.readtext
       stm.close
       set stm=nothing
       readfromtextfile=str
end function

str=readfromtextfile("test.htm","utf-8")
response.write(str)