每次我尝试将任何类型的字符串归因于此时,我都会得到未设置为对象实例的对象引用。我已经尝试了处理字符串的所有可能方式的组合,再次将其转换为字符串以及所有的模糊处理。这非常令人沮丧,我想这是结构/类使用和字符串数组或诸如此类的某种基本原则(这也很愚蠢)
Private Class movie
Public name As String
Public actors As String
Public year As Integer
Public country As String
Public votes As Integer
End Class
Private movies() As movie
If File.Exists(OpenFileDialog1.FileName) Then
lblPath.Text = OpenFileDialog1.FileName
Dim iFile As New StreamReader(lblPath.Text)
While Not iFile.EndOfStream
current = iFile.ReadLine
movies(i).name = "sasasasa"
lbMovies.Items.Add(movies(i).name)
i = i + 1
End While
End If
这些是我使用它的代码部分