是否可以在c#中添加二维列表?

是否可以在c#中添加二维列表?,c#,list,collections,C#,List,Collections,我有一份财产清单。我想为同一页面中的多个元素添加这些属性集合。那有点像 [0] => List ([0] => ID [1] => Name [2] => Add [3] => PhoneNo [4] => City) [1] => List (And so on.... internal class PropertiesCollection : List<P

我有一份财产清单。我想为同一页面中的多个元素添加这些属性集合。那有点像

[0] => List
       ([0] => ID
        [1] => Name
        [2] => Add
        [3] => PhoneNo
        [4] => City)
[1] => List
    (And so on....


internal class PropertiesCollection : List<Properties>
{
}

internal class Properties
{
}

PropertiesCollection collection = new PropertiesCollection ();

我相信你可以做一个列表

List<List<string>> list=new List<List<string>>();
List List=新列表();
然后,要访问单个元素,可以执行以下操作:

List<string> list=listlist[0];
        int i=list[0];
List List=listlist[0];
int i=列表[0];

或者使用foreach循环等。

我相信您可以创建列表列表

List<List<string>> list=new List<List<string>>();
List List=新列表();
然后,要访问单个元素,可以执行以下操作:

List<string> list=listlist[0];
        int i=list[0];
List List=listlist[0];
int i=列表[0];

或者使用foreach循环等。

您可以使用“列表”来做您想做的事情

private enum Property { ID = 0, Name, Add, PhoneNo, City };
string[] details = new string[5] { "1", "Frank Butcher". "Y", 
                                   "02087891256", "London (Albert Square)" };
List<string[]> propertyList = new List<string[]>();
propertyList.Add(details);

我希望这会有所帮助。

你可以使用“列表”来做你想做的事

private enum Property { ID = 0, Name, Add, PhoneNo, City };
string[] details = new string[5] { "1", "Frank Butcher". "Y", 
                                   "02087891256", "London (Albert Square)" };
List<string[]> propertyList = new List<string[]>();
propertyList.Add(details);
我希望这有帮助。

您可以使用:

List<PropertiesCollection> propColl = new List<PropertiesCollection>();
PropertiesCollection coll = new PropertiesCollection();
coll.Add(new Properties(some parameters));
coll.Add(new Properties(some parameters));
propColl.Add(coll);
propColl[0][0];
List propColl=new List();
PropertiesCollection coll=新的PropertiesCollection();
coll.Add(新属性(一些参数));
coll.Add(新属性(一些参数));
建议添加(coll);
propColl[0][0];
您可以使用:

List<PropertiesCollection> propColl = new List<PropertiesCollection>();
PropertiesCollection coll = new PropertiesCollection();
coll.Add(new Properties(some parameters));
coll.Add(new Properties(some parameters));
propColl.Add(coll);
propColl[0][0];
List propColl=new List();
PropertiesCollection coll=新的PropertiesCollection();
coll.Add(新属性(一些参数));
coll.Add(新属性(一些参数));
建议添加(coll);
propColl[0][0];

像多维数组一样?你不能使用属性集合列表吗?像多维数组一样吗?你不能使用属性集合列表吗?我怎样才能根据索引得到它?我怎样才能根据索引得到它?这可能是旧的,但是经过两天的激烈讨论和看了这么多关于数组的文章之后,列表和多维您的示例非常适合我的需要这可能已经很旧了,但是经过两天的讨论,看了这么多关于数组、列表和多维的文章后,您的示例非常适合我的需要