求大神求救:未能找到类型或命名空间名称“ArrayList”(是否缺少 using 指令或程序集引用?)
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespa...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication10
{
public class NameListEventArgs : EventArgs
{
public string Name { get; set; }
public int Count { get; set; }
public NameListEventArgs(string name, int count)
{
Name = name;
Count = count;
}
public delegate void NameListEventHandler(object source, NameListEventArgs args);
public class NameList
{
ArrayList list;
public event NameListEventHandler nameListEvent;
public NameList()
{
list = new ArrayList();
}
public void Add(string Name)
{
list.Add(Name);
if (nameListEvent != null)
{
nameListEvent(this, new NameListEventArgs(Name, list.Count));
}
}
}
这个是接下来的代码,不知道什么总是报错,我照着书里打的 展开
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication10
{
public class NameListEventArgs : EventArgs
{
public string Name { get; set; }
public int Count { get; set; }
public NameListEventArgs(string name, int count)
{
Name = name;
Count = count;
}
public delegate void NameListEventHandler(object source, NameListEventArgs args);
public class NameList
{
ArrayList list;
public event NameListEventHandler nameListEvent;
public NameList()
{
list = new ArrayList();
}
public void Add(string Name)
{
list.Add(Name);
if (nameListEvent != null)
{
nameListEvent(this, new NameListEventArgs(Name, list.Count));
}
}
}
这个是接下来的代码,不知道什么总是报错,我照着书里打的 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询