The code copy is as follows:
'Function name:ReadTextFile
'Function: Use the AdoDb.Stream object to read UTF-8 format text files
'----------------------------------------------------
FunctionReadFromTextFile(FileUrl,CharSet)
IfFileUrl=""ORIsNull(FileUrl)Then
ReadFromTextFile=""
ExitFunction
EndIf
IfNotFLib.IsReallyPath(FileUrl)Then
FileUrl=Server.MapPath(FileUrl)
EndIf
dimstr,stm
setstm=server.CreateObject("adodb.stream")
stm.Type=2' read in this mode
stm.mode=3
stm.charset=CharSet
stm.open
stm.loadfromfileFileUrl
str=stm.readtext
stm.Close
setstm=nothing
ReadFromTextFile=str
EndFunction
'-------------------------------------------------
'Function name: WriteToTextFile
'Function: Use the AdoDb.Stream object to write text files in UTF-8 format
'----------------------------------------------------
FunctionWriteToTextFile(FileUrl, byvalStr, CharSet)
IfFileUrl=""ORIsNull(FileUrl)Then
WriteToTextFile=""
ExitFunction
EndIf
IfNotFLib.IsReallyPath(FileUrl)Then
FileUrl=Server.MapPath(FileUrl)
EndIf
Dimstm
setstm=server.CreateObject("adodb.stream")