【发布时间】:2014-04-24 15:53:06
【问题描述】:
我有一个应用程序,它会不断地接受用户的输入并将输入存储在List 的class ItemsValue 中
我将如何做到这一点,以便一旦集合达到 1000 个计数,它将“停止”并创建一个新集合等等。
例如:
List<ItemsValue> collection1 = new List<ItemsValue>();
//User input will be stored in `collection1`
if (collection1.count >= 1000)
//Create a new List<ItemsVales> collection2,
//and the user input will be stored in collection2 now.
//And then if collection2.count reaches 1000, it will create collection3.
//collection3.count reaches 1000, create collection4 and so on.
【问题讨论】:
-
您可以制作收藏列表。但最初的目的是什么?
-
为什么?为什么不直接添加到同一个集合中?
-
为什么不直接使用 Take and Skip?
-
不,我们需要将数据临时存储在列表中,然后将数据传输到下一个应用程序中。
标签: c#