using System;using System.Collections.Generic;public class SiteList
{ protected SortedList<int, string> sites; //其他成員函數
public string this[int index]
{ get
{ if(index>sites.Count) return (string)null; return (string)sites.GetByIndex(inex)
}
} //其他東西 }這里VS提示“找不到GetByIndex的定義”,但是如果把using 中的Generic去掉的話,原來的“找不到定義”消失,卻又提示“非泛型 類型“System.Collections.SortedList”不能與類型實參一起使用”,難道帶參數的SortedList不是繼承不帶參數的SortedList嗎?
SortedList的用法問題
幕布斯6054654
2018-07-27 17:09:37