Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/304.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在类中添加图像列表?_C#_Image_List - Fatal编程技术网

C# 如何在类中添加图像列表?

C# 如何在类中添加图像列表?,c#,image,list,C#,Image,List,注意:该类位于项目中实现的my external DLL中。 在我的类库里有一个 里面有一张清单。 列表必须包含图像,但我的代码给了我一个错误 using System; using System.Collections.Generic; using System.Text; using System.Drawing; namespace BuyNowDLL { class Annuncio { public List<Image> Images1 =

注意:该类位于项目中实现的my external DLL中。 在我的类库里有一个 里面有一张清单。 列表必须包含图像,但我的代码给了我一个错误

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace BuyNowDLL
{
    class Annuncio
    {
       public List<Image> Images1 = new List<Image>();  //Make me error (Image)
    }
}
使用系统;
使用System.Collections.Generic;
使用系统文本;
使用系统图;
名称空间BuyNowDLL
{
安努西奥级
{
public List Images1=new List();//使我出错(图像)
}
}
我怎样才能修好它


您的代码没有任何错误,这是因为您没有引用System.Drawing.dll

在解决方案资源管理器中右键单击项目名称,然后单击添加>引用

然后在组件列表中选择检查
System.Drawing


错误信息是什么?我们怎么可能在不知道错误是什么的情况下回答这个问题?对不起,我是新来的。错误是:找不到类型或命名空间名称“Image”。可能缺少使用或程序集引用的指令@对不起,我没读那篇评论没问题。发生;)好的,但是类在我的dll中。我如何添加对它的引用@Ashkanmobayenkhiabani如果您已经导入了名称空间(
使用System.Drawing;
),只需按照以下步骤将引用添加到dll中即可。但是节点没有引用。请你看看我问题中的图片@AshkanMobayenKhiabani