[导入]ASP常用函数:LoadFromFile()

<%
'功能:获取文件数据流
'来源:http://jorkin.reallydo.com/article.asp?id=523

Function LoadFromFile(sFileName, sCharSet)
    
On Error Resume Next
    Dim
oStream
    Set oStream = Server.CreateObject("ADODB.Stream")
    
oStream.Type = 2
    
oStream.Mode = 3
    
oStream.Open
    oStream.Charset = sCharSet
    oStream.Position = oStream.Size
    oStream.LoadFromFile sFileName
    LoadFromFile = oStream.ReadText
    oStream.Close
    Set oStream = Nothing
    
Err.Clear
End Function
%>


文章来源:http://Jorkin.Reallydo.Com/default.asp?id=523
posted @ 2008-06-14 19:04  pboy2925  阅读(813)  评论(0编辑  收藏  举报