日期:2014-05-17 浏览次数:21182 次
sPath = "c:\1.txt"
Set oFM = CreateObject("Scripting.FileSystemObject")
If oFM.FileExists(sPath) Then
Set oFile = oFM.OpenTextFile(sPath, 1, False, 0)
title1 = oFile.ReadAll()
oFile.Close
Set oFile = Nothing
End If
Set oFM = Nothing
------解决方案--------------------
Function ReadFile(url, charset)
Dim stm
Set stm = Server.CreateObject("ADODB.Stream")
stm.Type = 1
stm.Mode = 1
stm.Open
stm.Position = 0
stm.LoadFromFile url
stm.Position = 0
stm.Type = 2
stm.Charset = charset
ReadFile = stm.ReadText()
stm.Close
Set stm = Nothing
End Function