I don't think VBArray is supported in C# applications:
Test complete script engine uses the Variant-array format that is not adopted in C#. So, to convert these values, you will have to call the UnWrap method of the var object.
The following code demonstrates how you can call the FindAllChildren method from a C# Connected Application:
void FindProcessMultiple()
{
// Creates arrays of properties and values
String[] PropArray = new String[2];
String[] ValuesArray = new String[2];
// Specifies property names
PropArray[0] = "ProcessName";
PropArray[1] = "UserName";
// Specifies the property values
ValuesArray[0] = "*";
ValuesArray[1] = Connect.Sys["UserName"];
// Searches for the process
var p = Connect.Sys;
var res = p["FindAllChildren"](new var(PropArray), new var(ValuesArray), 1);
// Posts the search results
if (Connect.BuiltIn["VarArrayHighBound"](res, 1) >= 0)
{
object[] ManagedArray = (object[])res.UnWrap();
for (int i = 0; i < ManagedArray.Length; i++)
{
var ArrayEntry = new var(ManagedArray);
Connect.Log["Message"]("Found: " + ArrayEntry["ProcessName"].UnWrap());
}
}
else
Connect.Log["Message"]("Not found");
}