string strID = "";
        string strClassName = "";
        CheckBox chk;
        foreach (System.Web.UI.WebControls.DataListItem dl in this.dlUserName.Items)
        {
            chk = (CheckBox)dl.FindControl("sel");
            if (chk.Checked)
            {
                string strUserID = this.dlUserName.DataKeys[dl.ItemIndex].ToString();
                strID += dr[0].ToString() + ",";
            }        }
将上面的代码给改成是用TreeView的
很急的