我想创建一个强类型的多维数组或集合,其中包含来自数据库的以下值:
- 文件名(作为字符串)
- 文件大小(整数)
要求:
- 可通过索引访问(例如 Arr(i)(j)、Arr.Row(i) 等)
- 高效(即快速且不占用资源)
- 易于操作、添加、附加等。
- .NET 3.5 兼容
感谢大家的精彩回答。这就是我去的... :)
Structure FileRecord
Dim Name As String
Dim Size As Integer
Sub New(ByVal FileName As String, ByVal FileSize As Integer)
Me.Name = FileName
Me.Size = FileSize
End Sub
Sub New(ByVal Files() As FileRecord)
For Each f As FileRecord In Files
Dim fr As New FileRecord(f.Name, f.Size)
Next
End Sub
End Structure