[.NET] 利用Streamreader讀取亂碼
Dim textread As StreamReader
Dim TextName As String
Dim textopen As String
With OpenFileDialog1
.FileName = "readme.txt"
.Filter = "document files(*.txt)|*.txt|All files(*.*)|*.*"
.FilterIndex = 1
End With
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
TextName = OpenFileDialog1.FileName
textread = New StreamReader(TextName,
System.Text.Encoding.Unicode, False)
TextBox1.Text = textread.ReadLine()
End If
這是我寫的程式讀取指令!!~~~
但是為什麼讀出來的都是亂碼!!~>"<~
可是卻又找不到問題點!!~"~
謝謝之前有人幫我解問題!!~~~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.118.241.137
→
10/15 09:35, , 1F
10/15 09:35, 1F
推
10/15 09:36, , 2F
10/15 09:36, 2F
→
10/15 09:36, , 3F
10/15 09:36, 3F
→
10/15 09:36, , 4F
10/15 09:36, 4F
→
10/15 09:42, , 5F
10/15 09:42, 5F
→
10/15 10:50, , 6F
10/15 10:50, 6F
→
10/15 10:51, , 7F
10/15 10:51, 7F
→
10/15 14:06, , 8F
10/15 14:06, 8F
→
10/15 14:07, , 9F
10/15 14:07, 9F
→
10/15 15:38, , 10F
10/15 15:38, 10F