为什么要使用 this 关键字呢?public int A1[int index]
{
        Get
         {
             return M5051[Index];
}
Set
{
    M5051[Index]=value;
}
}
public int A6[int index]
{
        Get
         {
             return M5056[Index];
}
Set
{
    M5056[Index]=value;
}
}

解决方案 »

  1.   

    spring_ok(SpringDotNet) 说的有问题,属性数组索引只能对this,你的程序根本调不通。
      

  2.   

    属性数组索引只能对this,有沒有人實現過
      

  3.   

    you cannot define multiple  
    public int this [int index]try to add another argument, for example   private int []  M5056 = {1,2};
       private int []  M5051 = {3,4};
       public int this [int index, int index2]
       {
            get
            {
       if (index2==0)
                 return M5056[index];
       else
         return M5051[index];
    }
    set
    {
          if (index2==0)
         M5056[index]=value;
          else
    M5051[index] = value;
    }
       }then you can do something like         CTest c = new CTest();
    Console.WriteLine(c[0,0]);
    Console.WriteLine(c[1,1]);
    c[0,0]=12;
    c[1,1]=24;
    Console.WriteLine(c[0,0]);
    Console.WriteLine(c[1,1]);