[.NET] 使用System IO只能讀取英文
我看了網路上的範例
測試時發現只能讀取英文和數字
中文讀取會變亂碼,是不是讀進來的中文還沒編碼完成
Imports System
Imports System.IO
Imports System.Collections
Module Module1
Sub Main()
Dim objReader As New StreamReader("c:\test.txt")
Dim sLine As String = ""
Dim arrText As New ArrayList()
Do
sLine = objReader.ReadLine()
If Not sLine Is Nothing Then
arrText.Add(sLine)
End If
Loop Until sLine Is Nothing
objReader.Close()
For Each sLine In arrText
Console.WriteLine(sLine)
Next
Console.ReadLine()
End Sub
End Module
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.104.147.165
推
01/02 15:04, , 1F
01/02 15:04, 1F
→
01/02 15:23, , 2F
01/02 15:23, 2F
→
01/02 15:32, , 3F
01/02 15:32, 3F
→
01/02 15:33, , 4F
01/02 15:33, 4F
→
01/03 12:57, , 5F
01/03 12:57, 5F