更新时间:2022-03-19 03:06:16
您无法创建动态命名的变量.您所能做的-用它创建一些集合或数组,并对其进行操作.我认为最适合您的课程是通用的列表<> :>
You can't create dynamically-named variables. All you can do - it to create some collection or array, and operate with it. I think the best class for you is generic List<>:
List<String> listWithDynamic = new List<String>();
for (int i = 1; i < limit; i +=1)
{
listWithDynamic.Add(string.Format("track_{0}", i));
...
}