下面介绍C#的集合类

1ArrayList
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
namespace 动态数组ArrayList
{
class Program
{
static void Main(string[] args)
{
ArrayList a1 = new ArrayList();
a1.Add(100);
foreach (int number in new int[6] { 9, 3, 7, 2, 4, 8 })
{
a1.Add(number);
}
int[] number2 = new int[2] { 11, 12 };
a1.AddRange(number2);
a1.Remove(3);
a1.RemoveAt(3);
ArrayList al2 = new ArrayList(a1.GetRange(1,3));
Console.WriteLine("遍历方法1:");
foreach (int i in a1)
{
Console.WriteLine(i);
}
Console.WriteLine("遍历方法2:");
for (int i = 0; i < al2.Count; i++)
{
Console.WriteLine(al2[i]);
}
Console.ReadLine();
}
}
}另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。