在C#中,我們對集合的數據,可以創建一個索引器的方法來訪問集合。如: class AS { public string[] Autos = { "德系","歐系","美系","日系","韓系"}; public string this[int index] { get { return Autos[ ...
在C#中,我們對集合的數據,可以創建一個索引器的方法來訪問集合。
如:
class AS { public string[] Autos = { "德系","歐系","美系","日系","韓系"}; public string this[int index] { get { return Autos[index]; } } }Source Code