惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
Blog — PlanetScale
Blog — PlanetScale
Vercel News
Vercel News
L
LangChain Blog
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
博客园_首页
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
罗磊的独立博客
美团技术团队
V
V2EX

博客园 - yzx99

哈希表用于Key与Value的对应 一次让代码更适应变化的经历(续) 一次让代码更适应变化的经历 C#中控件数组的讨论 C#下水晶报表打印自定义纸张 设计模式应用之一:控件清空 自定义StyleCop规则 恢复数据工具比较 SQL公式一直设不成功 不把text或image字段放最后的后果 要显示ASP调试信息,要把IE友好错误去掉 WMI的几种写法 - yzx99 - 博客园 计算机重启脚本 - yzx99 - 博客园 VB6设置进度条颜色 - yzx99 - 博客园 判断ListView双击了子项,并获取其位置与大小 VB6实现ListView各行间隔颜色 - yzx99 - 博客园 SQL查询优化一小例 让普通用户查询安全日志 WMI代码运行错误:80041003
错误提示与实际问题不符合的案例之一
yzx99 · 2013-10-18 · via 博客园 - yzx99

今天写一个类实现 IList 接口时,编译不成功,提示
使用泛型 类型“System.Collections.Generic.IList<T>”需要“1”个类型实参

开头以为自己格式写不对,但找一下网络,结果让人大跌眼镜,居然是:
漏了using System.Collections;这句话

实现该错误的代码如下:
using System;
using System.Collections.Generic;
namespace WindowsFormsApplication12
{
    public class MyCollection : System.Windows.Forms.ListBox.ObjectCollection, IList  //, IDictionary
    {
        public MyCollection(System.Windows.Forms.ListBox owner):base(owner)
        {
        }
    }
}

其中,如果把构造函数去掉,又会产生如下错误
“System.Windows.Forms.ListBox.ObjectCollection”不包含采用“0”参数的构造函数