VB笔记

作者: John_Tsemin | 来源:发表于2018-06-13 17:04 被阅读17次

    VB读取utf-8文档

    Public Function ReadUTF8(ByVal sUTF8File As String) As String
     If Len(sUTF8File) = 0 Or Dir(sUTF8File) = vbNullString Then Exit Function
     Dim ados As Object
     Set ados = CreateObject("adodb.stream")
     With ados
         .Charset = "utf-8"
         .Type = 2
         .Open
         .LoadFromFile sUTF8File
         ReadUTF8 = .ReadText
         .Close
     End With
     Set ados = Nothing
    End Function
    

    相关文章

      网友评论

          本文标题:VB笔记

          本文链接:https://www.haomeiwen.com/subject/cutseftx.html