我編寫了這個代碼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?然後,他們走了。改爲使用列表。 –