// C#
int[,,] result = (int[,,]) ml.GetArray(typeof(int), 3);
// VB
Dim result(,,) as Integer = CType(ml.GetArray(GetType(Integer), 3), GetType(Integer(,,)))
This method only works for arrays that are rectangular, not jagged. In other words, you can read a Wolfram Language list like this: {{1,2,3},{4,5,6}} but not like this: {{1,2,3},{4,5}}.
For reading one-dimensional arrays, there are convenience functions for all the simple types, such as GetInt32Array, GetBooleanArray, GetStringArray, and so on. These methods are typed to return the specified type of array, so no casting is required.GetArray(Type, Int32) | Reads an array and discards information about the heads at each level. |
GetArray(Type, Int32, String) | Reads an array and records information about the heads at each level. |