参考资料和例子都行,这里谢过了

解决方案 »

  1.   

    你说的是索引器?索引器允许类或结构的实例就像数组一样进行索引。索引器类似于属性,不同之处在于它们的访问器采用参数。在下面的示例中,定义了一个泛型类,并为其提供了简单的 get 和 set 访问器方法(作为分配和检索值的方法)。Program 类为存储字符串创建了此类的一个实例。C#  复制代码 
    class SampleCollection<T>
    {
        private T[] arr = new T[100];
        public T this[int i]
        {
            get
            {
                return arr[i];
            }
            set
            {
                arr[i] = value;
            }
        }
    }// This class shows how client code uses the indexer
    class Program
    {
        static void Main(string[] args)
        {
            SampleCollection<string> stringCollection = new SampleCollection<string>();
            stringCollection[0] = "Hello, World";
            System.Console.WriteLine(stringCollection[0]);
        }

      

  2.   

    索引器?
    索引器允许类或结构的实例就像数组一样进行索引。索引器类似于属性,不同之处在于它们的访问器采用参数。在下面的示例中,定义了一个泛型类,并为其提供了简单的 get 和 set 访问器方法(作为分配和检索值的方法)。Program 类为存储字符串创建了此类的一个实例。
    class SampleCollection<T>
    {
        private T[] arr = new T[100];
        public T this[int i]
        {
            get
            {
                return arr[i];
            }
            set
            {
                arr[i] = value;
            }
        }
    }// This class shows how client code uses the indexer
    class Program
    {
        static void Main(string[] args)
        {
            SampleCollection<string> stringCollection = new SampleCollection<string>();
            stringCollection[0] = "Hello, World";
            System.Console.WriteLine(stringCollection[0]);
        }
    }
    使用索引器可以用类似于数组的方式为对象建立索引。get 访问器返回值。set 访问器分配值。this 关键字用于定义索引器。value 关键字用于定义由 set 索引器分配的值。索引器不必根据整数值进行索引,由您决定如何定义特定的查找机制。索引器可被重载。索引器可以有多个形参,例如当访问二维数组时。
      

  3.   

    你说的是什么东西?
    Attribute??
      

  4.   

    [] 是Attribute标签 
    http://msdn.microsoft.com/zh-cn/library/system.attribute(VS.80).aspx
      

  5.   

    int[] nums = {1, 2, 3};
    int x=2;
      

  6.   

    到MSDN输入[]一回车,所有相关的东西就都出来了
      

  7.   

    挺多 
    1   索引 比如  string[] a = new string[6] ;
                       a[0] = "a" ;
                       a[1] = "b";
    从0开始   5结束 。
     另外 ,DataTable  dt ;
         dt.Row[2][3] 指表的第三行第4列  。
         dt.Row[2]["cols"] 指表的第三行列名cols的列。
         hashTable["asd"]   session["key"]   ViewState["key"]   用法都差不多2   属性
    比如页面有个textbox    想给他加个属性        textbox.Attribute["value","值"]
                   
      

  8.   

    对,我说的就是Attribute,我希望比较详细的了解到,谢谢楼上的所有人
      

  9.   

               //定义数组
                string[] str_array = new string[] { "Hello" };            //每次循环显示一个字母
                for (int i = 0; i < str_array.Length; i++)
                {
                    Console.Write(str_array[i]);
                }            Console.ReadLine();
      

  10.   

    http://sifang2004.cnblogs.com/archive/2006/01/12/316313.html
      

  11.   

    http://msdn.microsoft.com/zh-cn/library/system.attribute(VS.80).aspx
      

  12.   

    http://www.pconline.com.cn/pcjob/process/other/others/0409/445997.htmlhttp://www.pconline.com.cn/pcjob/process/other/others/0409/446014.html