我有以下问题。如何在 C# 中创建对象数组?我正在考虑我通常在 PHP 中使用的这种方法:
$obj1 = new stdClass();
$obj1->first = "first-str";
$obj2 = new stdClass();
$obj2->second = "second-str";
$objarray = array();
$objarray['first'] = $obj1;
$objarray['second'] = $obj2;
echo $objarray['second']->second;