0

嗨,SO的好人,

我在这里面临一个小挑战,我无法弄清楚。所以我有一个使用以下内容创建的二维数组:

var portTypes = assembly.GetExportedTypes();
string[,] commonIPPort= new string [2,2];
foreach (var v in portTypes )
        {
            if (v.FullName == "iControl.CommonIPPortDefinition")
            {
                commonIPPort= new string[,] { { v.Name, v.FullName }};
            }
        }
dynamic ports= Array.CreateInstance(typeof(object),commonIPPort.Length); 

这是我得到空错误的地方: object item;

for (int i = 0; i < commonIPPort.Length; i++)
        {
            item = Activator.CreateInstance(Type.GetType(commonIPPort[i,i+1]));

        }

所以我的问题是如何在二维字符串上使用 createinstance ?

先感谢您。

4

0 回答 0