当我创建一个类并使用该Sub New()
选项时,我想遍历 16 个 1d 和 2d 双精度数组并将所有元素设置为 999999999。我在下面有以下代码,但编译器不喜欢它。有谁能够帮助我?
For Each p As PropertyInfo In Me.GetType().GetProperties()
If p.CanRead AndAlso p.PropertyType.Name.IndexOf("Double[]") > -1 Then
For x As Integer = 0 To DirectCast(p.GetValue(Me, Nothing), Double()).GetLength - 1
'code to set array element = 999999999
Next
End If
Next