展开全部
Function saveUnicode()Function saveUnicode()function saveUnicode(byval str as string,FileName as string)
dim data() as byte,fnu as integer
fn=freefile
data=str
Open FileName For Binary Access Write As #fnu
Put #fnu, , Data
Close #fnu
end functionVB内部处理字符就是用UNICODE,所以在VB要保存字符为UNICODE格式如此简单
=========================
或是用这个
Sub WriteToTextFile(FileUrl, ByVal Str, CharSet)
Set stm = 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 Sub
dim data() as byte,fnu as integer
fn=freefile
data=str
Open FileName For Binary Access Write As #fnu
Put #fnu, , Data
Close #fnu
end functionVB内部处理字符就是用UNICODE,所以在VB要保存字符为UNICODE格式如此简单
=========================
或是用这个
Sub WriteToTextFile(FileUrl, ByVal Str, CharSet)
Set stm = 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 Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询