• 绑定People and Group


      private void BindOwner()
             {
                 using (SPSite site = new SPSite(siteurl))
                 {
                     using (SPWeb web = site.OpenWeb())
                     {
                         DataTable ownerTable = Make_Table();
                         foreach (SPUser user in web.SiteGroups["Owner"].Users)
                         {
                             if (user.Name != "System Account")
                             {
                                 DataRow row = ownerTable.NewRow();
                                 row["Name"] = user.Name;
                                 row["LoginName"] = user.LoginName;
                                 ownerTable.Rows.Add(row);
                             }
                         }
                         DropDownListOwner.DataSource = ownerTable;
                         DropDownListOwner.DataTextField = "Name";
                         DropDownListOwner.DataValueField = "LoginName";
                         DropDownListOwner.DataBind();
                     }
                 }
             }


             private DataTable Make_Table()
             {
                 DataTable nameTable = new DataTable("Names");
                 nameTable.Columns.Add("Name");
                 nameTable.Columns.Add("LoginName");
                
                 return nameTable;
             }

  • 相关阅读:
    敏感词过滤
    Tarjan+topsort(DP)【P3387】 [模板]缩点
    树状数组【CF703D】Mishka and Interesting sum
    组合数学+错排问题【p4071】[SDOI2016]排列计数
    Dijkstra【p3003(bzoj2100)】[USACO10DEC]苹果交货Apple Delivery
    Trie树【p2264】情书
    线段树+扫描线【p1884】[Usaco12FEB]过度种植(银)Overplanting …
    区间DP【p4290】[HAOI2008]玩具取名
    暴力 【p4092】[HEOI2016/TJOI2016]树
    暴力 【p4098】[HEOI2013]ALO
  • 原文地址:https://www.cnblogs.com/KingStar/p/1594562.html
Copyright © 2020-2023  润新知