|
查看: 1579|回复: 2
|
请问 VB.NET 如何把File写成Unicode
[复制链接]
|
|
|
请问一下高手我用的是 VB.net 2005 我把File Write 成 Binary Mode 后 在 Textbox时是 "你好吗" 但是当我Read回那个File textbox就变回 这样 "???" 很多问号
为什么。。。如何把它转换成UNICODE |
|
|
|
|
|
|
|
|
|
|
发表于 21-6-2006 10:28 AM
|
显示全部楼层
试试看这简单的 code... 在我电脑上可以正常操作
' 写入
Dim sw As StreamWriter = File.CreateText("test.txt")
sw.WriteLine(Me.MyTextBox.Text)
sw.Close()
' 读出
Dim sr As StreamReader = New StreamReader("test.txt")
Dim line As String
Do
line = sr.ReadLine()
MsgBox(line)
Loop Until line Is Nothing |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 21-6-2006 05:19 PM
|
显示全部楼层
原帖由 goatstudio 于 21-6-2006 10:28 AM 发表
试试看这简单的 code... 在我电脑上可以正常操作
' 写入
Dim sw As StreamWriter = File.CreateText("test.txt")
sw.WriteLine(Me.MyTextBox.Text)
sw.Cl ...
可以操作了谢谢您! 可是为何不能用FileOpen 呢 |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|