asp数据文件并设置编码
网络整理 - 09-05
function ReadText(FileName) '这是一个用于读出文本文件的函数
On Error Resume Next
set adf=server.CreateObject("Ado"&"db.Str"&"eam")
if instr(filename,":")<>0 then
path=filename
else
path=server.MapPath(FileName)
end if
with adf
' response.write path
.Type=2
.LineSeparator=13
.Open
.LoadFromFile (path)
.Charset="GB2312"
.Position=2
ReadText=.ReadText
.Cancel()
.Close()
end with
set adF=nothing
end function