带逗号的字符串变成数组

 string[] builtWay = b.builtWay.Split(',');
            for (int i = 0; i < builtWay.Length; i++)
            {
                foreach (Control c in Panel1.Controls)
                {
                    if (c is CheckBox)
                    {
                        CheckBox cb = (CheckBox)c;
                        if (cb.Text == builtWay[i])
                        {
                            cb.Checked = true;
                        }
                    }
                }
            }

 

posted on 2012-01-04 16:21  MyBeN  阅读(254)  评论(0)    收藏  举报

导航