Dynamically build an array for web service

后端 未结 5 1009
既然无缘
既然无缘 2021-01-27 01:55

I\'m using C# and asp.net to query a web service.

The user will enter the number of guests and then I need to add that number of guests to the web service call. Creati

5条回答
  •  既然无缘
    2021-01-27 02:17

    I suggest you use a List. You can initialize the size with the number of guests when you create it, but that is really just an optimization. If you want to add more guests later, you can do that and the List will resize as necessary.

    List has a ToArray() method if you want to turn the list into an array for some reason.

提交回复
热议问题