在VB.net中使用'Invoke'通过反射调用方法时如何读取返回的复杂对象值
How to read the returned complex object values when calling a method by reflection using 'Invoke' in VB.net
正如您在图片中看到的那样,我从调用中看到了 return 值,但我无法使用它们。
如何将 return 对象转换为其他对象。这个函数是动态的,所以我不能为此使用参考对象 class.
谢谢!
我设法通过使用 this
读取了对象
Dim oResults As Object = oMethod.Invoke(oUbCustomerService, oParameterValues)
For Each oResult in oResults
Dim oFieldInfoList() As FieldInfo = oResult.GetType().GetFields
dim strValue as String = oFieldInfoList(n).GetValue(oResult)
...
Next
正如您在图片中看到的那样,我从调用中看到了 return 值,但我无法使用它们。
如何将 return 对象转换为其他对象。这个函数是动态的,所以我不能为此使用参考对象 class.
谢谢! 我设法通过使用 this
读取了对象Dim oResults As Object = oMethod.Invoke(oUbCustomerService, oParameterValues)
For Each oResult in oResults
Dim oFieldInfoList() As FieldInfo = oResult.GetType().GetFields
dim strValue as String = oFieldInfoList(n).GetValue(oResult)
...
Next