SharePoint 2007不存在判断用户组isExist的方法,因此只有自己写一个喽:

 

public static bool GroupExists(SPGroupCollection groups, string name)

{

if (string.IsNullOrEmpty(name) ||

(name.Length > 255) ||

(groups == null) ||

(groups.Count == 0))

return false;

else

return (groups.GetCollection(new String[] { name }).Count > 0);

}

public static bool GroupExists(SPGroupCollection groups, int id)

{

if ((id < 0) ||

(groups == null) ||

(groups.Count == 0))

return false;

else

return (groups.GetCollection(new Int32[] { id }).Count > 0);

}

相关文章:

  • 2021-09-26
  • 2022-12-23
  • 2022-03-03
  • 2022-03-09
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
猜你喜欢
  • 2021-10-20
  • 2022-12-23
  • 2022-03-09
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案