分享

写回答

发帖

[提问] ASP读取服务器上的txt文件显示乱码,求解决方法

回答|共 10 个

北极末端

发表于 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 | 显示全部楼层

回复 11# 的帖子

我也不懂.
RAKSmart
您需要登录后才可以回帖 登录 | 注册

本版积分规则