private DataSet LoadDataInfo() { #region 加载数据 DataSet dsSrc = new DataSet(); DataTable dt = UserGroups.GetOnlineList(); dsSrc.Tables.Add(dt.Clone()); foreach (DataRow dr in dt.Rows) { dsSrc.Tables[0].ImportRow(dr); } dsSrc.Tables[0].Columns.Add("newdisplayorder"); dsSrc.Tables[0].Rows[0]["GroupName"] = "普通用户"; foreach (DataRow dr in dsSrc.Tables[0].Rows) { if (!Utils.IsNumeric(dr["displayorder"].ToString()) || dr["displayorder"].ToString() == "0") { dr["newdisplayorder"] = "不显示"; } else { dr["newdisplayorder"] = dr["displayorder"].ToString(); } } DataTable dt2 = new DataTable("img"); dt2.Columns.Add("imgfile", Type.GetType("System.String")); DataRow dr2 = dt2.NewRow(); dr2["imgfile"] = ""; dt2.Rows.Add(dr2); try { DirectoryInfo dirinfo = new DirectoryInfo(Server.MapPath("../../images/groupicons")); foreach (FileSystemInfo file in dirinfo.GetFileSystemInfos()) { if ((file != null) && (file.Extension != "")) { dr2 = dt2.NewRow(); if (file.Name.ToLower() == "thumbs.db") { continue; //过滤掉Thumbs.db文件 } dr2["imgfile"] = file.Name; dt2.Rows.Add(dr2); } } dsSrc.Tables.Add(dt2); dsSrc.Relations.Add(dt2.Columns["imgfile"], dsSrc.Tables[0].Columns["img"]); } catch { ; } return(dsSrc); #endregion }