【发布时间】:2010-01-29 22:00:28
【问题描述】:
我将 C# 代码中的类型名称和一些参数传递到用 VB 编写的导航框架中。导航框架在与使用 Type.GetConstructor(Types()) 传入的参数匹配的类型上查找构造函数。我正在寻找的构造函数需要一个整数数组——vb 中的 Integer()。但它得到一个 System.Int32 数组。我已经尝试过这个:
System.Int32[] int32Array = IdList.ToArray();
int[] intArray = new int[int32Array.Length];
for (int i = 0; i < int32Array.Length; i++ )
{
intArray[i] = (int)int32Array[i];
}
并且VB代码在另一端仍然看到System.Int32,这意味着它没有找到构造函数。
有什么见解吗?
【问题讨论】:
标签: c# vb.net reflection interop constructor