首先设计如下界面;

编写如下代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;//引入包
namespace 动态数组
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
label3.Text = "";
}
ArrayList arr = new ArrayList();
public void display()
{
foreach(object x in arr)
{
Student s = (Student)x;
label

该博客介绍了如何在C#中使用ArrayList进行学生集合的管理,包括添加、删除、插入和遍历操作。通过创建Student类来表示学生信息,并在Form1中实现交互界面,实现了动态添加、在指定位置插入、遍历显示和按位置删除学生信息的功能。
最低0.47元/天 解锁文章
1481

被折叠的 条评论
为什么被折叠?



