如:
string[] ss = 获取数组。。
ss.什么东东()加数据?就像js中的push()这种的没有的话,要怎么实现?

解决方案 »

  1.   

    建议使用List,ArrayList 等
    有Add方法
      

  2.   


            List<string> list = new List<string>();
            list.Add("A");
            ArrayList arrList = new ArrayList();
            arrList.Add("B");
            Hashtable tabList = new Hashtable();
            tabList.Add("Key", "Value");//Key不允许重复
             //...
      

  3.   

    使用数组的方法
    String[] x = {"A","B"};
    Array.Resize(ref x, x.Length+1);
    x[x.Length - 1] = "newvalue";
      

  4.   

    Dictionary<int, string> array=new Dictionary<int, string>();
    array.Add(0, "1");
    array.Add(1, "2");
      

  5.   

      protected void Page_Load(object sender, EventArgs e)
      {
        String[] x = { "A", "B" };
        Array.Resize(ref  x, x.Length + 1);
        x[x.Length - 1] = "newvalue";
        for (int i = 0; i < x.Length;i++ )
          Response.Write(x[i] + "<br>");
      }
    不是把newvalue加进去了吗?