Multiple parameters in a List. How to create without a class?

后端 未结 10 2014
不知归路
不知归路 2020-12-12 23:25

This is probably a pretty obvious question, but how would I go about creating a List that has multiple parameters without creating a class.

Example:

10条回答
  •  清歌不尽
    2020-12-13 00:22

    If you are using .NET 4.0 you can use a Tuple.

    List> list;
    

    For older versions of .NET you have to create a custom class (unless you are lucky enough to be able to find a class that fits your needs in the base class library).

提交回复
热议问题