本帖最后由 xiaotiange 于 2010-08-21 10:01:17 编辑

解决方案 »

  1.   

    可变数组使用List<string> lst=new List<string>();
    等保存
      

  2.   


                List<byte> strarr = new List<byte>() ;
                int rowcount = 0;
                string value = "";
                foreach (DataGridViewRow dr in this.dataGridView1.Rows)
                {
                    DataGridViewCheckBoxCell cbx = dr.Cells[0] as DataGridViewCheckBoxCell;
                    strarr = new string[rowcount];                try
                    {
                        if ((bool)cbx.Value)
                        {
                            rowcount++;
                            value = (string)dr.Cells[1].Value;
                        }
                        strarr.Add(value);                }
                    catch
                    {
                        return;
                    }            }
      

  3.   

    List<byte> strarr = new List<byte>() ;
    ---》
    List<string> strarr = new List<string>();