สร้างรายการ c#
using System.Collections.Generic
//type is your data type (Ej. int, string, double, bool...)
List<type> newList = new List<type>();
ทำให้รายชื่อ c#
IList<int> newList = new List<int>(){1,2,3,4};
วิธีที่จะสร้างรายการ c#
C# By Magnificent Mamba on Dec 23 2019
IList<int> newList = new List<int>(){1,2,3,4};
วิธีที่จะทำให้รายชื่ออยู่ใน c#
// This Example uses Object list but you can do Lists from Everything you want.
// It works like Arrays.
public List<object> objects = new List<object>();
public void AddToList(object arg)
{
// Add Objects to the list with:
objects.Add(arg);
}
public object[] GetObjects()
{
return objects.ToArray();
}