越来越菜了  
public static string ejqx  //二级权限
    {
        get { return "供求信息,优势资源,文章管理,招聘管理,在线劳务"; }
    }        ListBox1.DataSource = ejqx.Split(',');
        ListBox1.DataBind();
现在想用数组获取Listbox的值, 并且仍然以  供求信息,优势资源   中间为逗号这种形式.String [] a=listbox.??还是?

解决方案 »

  1.   


    string[] str = ListBox1.DataSource as string[];
      

  2.   


    string aa = "";
            for (int i = 0; i < ListBox1.Items.Count; i++)
            {
                if (i == ListBox1.Items.Count - 1)
                {
                    aa += ListBox1.Items[i].Text.ToString();
                }
                else
                {
                    aa += ListBox1.Items[i].Text.ToString() + ",";
                }        }
      

  3.   


    那么写是可以的,你报错 是因为ListBox1.DataSource 为null 或不能被转换为string []