我會不斷記錄用戶輸入的應用程序和輸入存儲在class ItemsValue
創建集動態在C#
一個List
我怎麼讓它這樣一旦集合達到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.
您可以製作收藏列表。但最初的目的是什麼? –
爲什麼?爲什麼不只是添加到相同的集合? – Euphoric
[XY問題?](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) – Liam