亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

利用AdoDb.Stream對(duì)象來(lái)讀取UTF-8格式的文本文件

 更新時(shí)間:2006年10月11日 00:00:00   作者:  
復(fù)制代碼 代碼如下:

'函數(shù)名稱(chēng):ReadTextFile
    '作用:利用AdoDb.Stream對(duì)象來(lái)讀取UTF-8格式的文本文件
    '----------------------------------------------------
    Function ReadFromTextFile (FileUrl,CharSet)
        If FileUrl = "" OR IsNull(FileUrl) Then
            ReadFromTextFile = ""
            Exit Function
        End If
        If Not FLib.IsReallyPath(FileUrl) Then
            FileUrl = Server.MapPath(FileUrl)
        End If
        dim str, stm
        set stm=server.CreateObject("adodb.stream")
        stm.Type=2 '以本模式讀取
        stm.mode=3 
        stm.charset=CharSet
        stm.open
        stm.loadfromfile FileUrl
        str=stm.readtext
        stm.Close
        set stm=nothing
        ReadFromTextFile=str
    End Function
    '-------------------------------------------------
    '函數(shù)名稱(chēng):WriteToTextFile
    '作用:利用AdoDb.Stream對(duì)象來(lái)寫(xiě)入U(xiǎn)TF-8格式的文本文件
    '----------------------------------------------------
    Function WriteToTextFile (FileUrl,byval Str,CharSet)   
        If FileUrl = "" OR IsNull(FileUrl) Then
            WriteToTextFile = ""
            Exit Function
        End If
        If Not FLib.IsReallyPath(FileUrl) Then
            FileUrl = Server.MapPath(FileUrl)
        End If
        Dim stm
        set stm=server.CreateObject("adodb.stream")
        stm.Type=2 '以本模式讀取
        stm.mode=3
        stm.charset=CharSet
        stm.open
        stm.WriteText str
        stm.SaveToFile FileUrl,2    
        stm.flush
        stm.Close
        set stm=nothing
    End Function

相關(guān)文章

最新評(píng)論