ListBox多先框将选中项连接成字符串

               string strCellno = "";
                foreach (ListItem item in this.LBdel.Items)
                {
                    strCellno += "'" + item.Value.ToString() + "'";
                    strCellno += ",";
                }
                //for (int s = 0; s < deptList.Count; s++)
                //{
                //    strDept += "'" + deptList[s].ToString() + "'";
                //    strDept += ",";
                //}
                strCellno = strCellno.Remove(strCellno.Length - 1, 1);//去掉最後一個‘,’
posted @ 2008-12-01 13:52  XGU_Winner  阅读(179)  评论(0编辑  收藏  举报