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
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