VB 读写UTF8文本文件

前端之家收集整理的这篇文章主要介绍了VB 读写UTF8文本文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
1.VB写入utf-8文本文件

Dim adostream As New ADODB.Stream
With adostream
.Type = adTypeText
.Mode = adModeReadWrite
.Charset = "utf-8"
.Open
.Position = 0
.WriteText "木子屋-http://www.mzwu.com/"
.SaveToFile "D:\test.txt",adSaveCreateOverWrite
.Close
End With
Set adostream = Nothing

2.VB读取utf-8文本文件

Dim adostream As New ADODB.Stream With adostream .Type = adTypeText .Mode = adModeReadWrite .Charset = "utf-8" .Open .LoadFromFile "D:\test.txt" MsgBox .ReadText .Close End With Set adostream = Nothing

猜你在找的VB相关文章