我正在尝试使用以下内容添加到 ArrayList。
Dim lines() As String = IO.File.ReadAllLines("C:\xTools\messages.txt")
For Each line As String In lines
Dim parts As String() = line.Split(New String() {":"}, StringSplitOptions.None)
Dim message As String = String.Join(" ", parts)
If Not message = Nothing Then
Messages.Add(message)
End If
Next
我得到的只是 NullReferenceExceptions on Messages.Add(message)
。请指教。