[提问]
ASP读取服务器上的txt文件显示乱码,求解决方法
|
|
北极末端
发表于 2010-8-4 14:22:53
|
显示全部楼层
回复 10# 的帖子
Dim path,FsoObj,tempfileOBJ,txt
Path = server.mappath(Request.ServerVariables("SCRIPT_NAME"))
Path=left(Path,instrrev(Path,"\" ) - 1 )
path=Path & "/" & RS("urls")
Set FsoObj=Server.CreateObject("Scripting.FileSystemObject")
IF FSOObj.FileExists(path) = True then
Set tempfileOBJ = FsoObj.OpenTextFile(path, 1, 0, 0 )
While NOT tempfileOBJ.AtEndOfStream
txt=txt & tempfileOBJ.ReadLine & vbNewLine
Wend
Set tempfileOBJ=Nothing
end if
Set FsoObj=Nothing
if len(txt)>2 then txt=trim(left(txt,len(txt)-2))
不懂啊~~帮我改下好吗? |
|
|
|
|
|
|
|
|
|
|
add.c
发表于 2010-8-4 14:58:17
|
显示全部楼层
|
|
|
|
|
|
|
|