【发布时间】:2016-03-17 05:01:15
【问题描述】:
目前我遇到了一个问题/正在努力了解如何从类模块中提取信息。 我的理解是,如果类模块是 Excel 表,则实例将是一行,公共属性将是我在查看链接(Retrieving information from a Class module VB.Net)之前发布此问题的列,这是我使用代码的地方
在我的类模块中
Public Class tDCVillains
Public Property Gothem As Integer
Public Property metropolis as Integer
End Class
将信息插入类模块
Sub GrabAccessInfo()
Dim DCVillains As New tDCVillains
Dim VillainsCollection As New Collection
DCVillains.Gothem = rst("Gothem").Value
DCVillains.metropolis = rst("metropolis").Value
VillainsCollection.Add(DCVillains)
rst.MoveNext()
End Sub
从类模块中检索信息
Sub RackSlotAccess(DCVillains As tDCVillains)
For Each tDCVillains As System.Reflection.PropertyInfo In tDCVillains ' its not liking tDCVillains
Dim ObjGothem = DCVillains.Gothem
Dim Objmetropolis = DCVillains.metropolis
If ObjGothem >= 1 Then
InsertGothemVillains(ObjGothem, 32, "I", Slot, Rack)
End If
If Objmetropolis >= 1 Then
InsertmetropolisVillains(Objmetropolis, 16, "I", Slot, Rack)
End If
Next
End Sub
它是代码不喜欢的每个语句,但我不知道为什么?
【问题讨论】:
标签: vb.net excel class class-method class-variables