私は古い Web アプリケーション (vb.net 2003) で作業しており、カスタム クラスの汎用リストを使用しようとしています。
リンクによると、System.Collections.Genericが.Net 2で導入されたことに気付きました
リストに代わるものはありますか?たとえば、クラスの配列?
次のクラス定義があるとします。
Public Class Box
Public x As Integer
Public y As Integer
End Class
クラスボックスの配列:
Dim BoxList() As Box
BoxList(0).x = 1
BoxList(0).y = 1
BoxList(1).x = 2
BoxList(2).y = 2
しかし、エラーが発生するとエラーが発生しBoxList(0).x = 1
ます:Object reference not set to an instance of an object
私はここで推測しています。