====ディレクトリ再帰、配列、StringBuilder====
System::Void recursiveDir(DirectoryInfo^ dir, int depth) {
array<<DirectoryInfo^>>^ dirs = dir->>GetDirectories(); for (int i=0; i < < dirs->>Length ; i++) {
recursiveDir(dirs[i], depth + 1);
Debug::Print(getIndent(depth) + dirs[i]->>Name);
}
}
System::String^ getIndent(int depth) {
System::Text::StringBuilder^ sb = gcnew System::Text::StringBuilder();
for (int i=0; i<<depth; i++) { sb->>Append(L"\t");
}
return sb->>ToString();
}
----