【发布时间】:2017-04-17 19:55:38
【问题描述】:
当我传递一个 PHP 索引数组时:
$myVar = new COM('MyClass');
$myVar->DubbleArray([1, 2]);
...它作为 System.Object[] 传递给 C# 或 F#,我可以相应地处理它,例如:
[<ComVisible(true)>]
type LettersClass() =
member this.DubbleArray(array: obj[]) =
// do stuff with the values in the array
但是当我传递一个关联数组时:
$myVar->DubbleArray(array('first'=>'1st','second'=>'2nd'));
...它以 DBNull 的形式出现。
有没有办法通过 COM 将关联数组传递给 .NET 函数?
【问题讨论】: