我编写了这个代码private ArrayList articles = new ArrayList();
,它只是不会编译。 Visual Studio是给我这个错误:在System.Collections中找不到ArrayList类型
The type or namespace name 'ArrayList' could not be found (are you missing a using directive or an assembly reference?)
但我确信导入System.Collections命名空间。 我即使
System.Collections.ArrayList articles = new ArrayList();
但没有成功尝试无论是。感谢您的帮助
System.Collections.ArrayList articles = new System.Collections.ArrayList(); 将在那里是正确的语法。但是,如果你已经包含了一个适当的命名空间的使用语句,它肯定会奏效;唯一的问题可能是该组件在您的项目中根本没有被引用。 – Bogey
这里检查定义和示例https://msdn.microsoft.com/en-us/library/system.collections.arraylist(v=vs.110).aspx#Anchor_7 – Nkosi
您是否使用Metro应用程序或UWP?然后,他们走了。改为使用列表。 –