カスタムクラスは初めてです。これが私のクラス定義です:
Public Class game
Private strName As String()
Property name As String()
Get
Return strName
End Get
Set(ByVal Value As String())
strName = Value
End Set
End Property
End Class
そして、これがファイルから読み取って「ゲーム」のインスタンスを作成するための私のコードです
Public Sub loadGames()
Dim game As New game
Dim dir As New IO.DirectoryInfo(gameFolder)
Dim fs As IO.FileInfo() = dir.GetFiles("*.gemui")
Dim f As IO.FileInfo
For Each f In fs
Dim path As String = f.FullName
Dim fi As New FileInfo(path)
Dim sr As StreamReader = fi.OpenText()
Dim s As String = ""
While sr.EndOfStream = False
game.name = sr.ReadLine() '"Value of type 'String' cannot be converted to '1-dimensional array of String'."
MsgBox(sr.ReadLine()) 'shows a message box with exactly what I expect to see
End While
sr.Close()
Next
End Sub
game.name = sr.ReadLine()が問題です。 「タイプ「文字列」の値を「文字列の1次元配列」に変換できません。」