79331302

Date: 2025-01-05 18:26:28
Score: 1.5
Natty:
Report link

Use CallByName or Reflection as discussed here:

Dynamically invoke properties by string name using VB.NET

Example:

Private Class Calculations
    Public Function calc(ByVal ParamArray args() As Integer) As Integer
       Return args(0) * 2
    End Function
End Class
Dim args(1) As Integer
args(0) = 2
Dim result = Microsoft.VisualBasic.CallByName(calculator, "calc", Microsoft.VisualBasic.CallType.Get, 7)

'result = 14
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Gary S