本文整理匯總了C#中System.Web.Security.MembershipUserCollection.Remove方法的典型用法代碼示例。如果您正苦於以下問題:C# MembershipUserCollection.Remove方法的具體用法?C# MembershipUserCollection.Remove怎麽用?C# MembershipUserCollection.Remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Web.Security.MembershipUserCollection
的用法示例。
在下文中一共展示了MembershipUserCollection.Remove方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Remove_Unexisting
public void Remove_Unexisting ()
{
MembershipUserCollection muc = new MembershipUserCollection ();
muc.Add (GetMember ("me"));
muc.Remove ("me too");
}
示例2: Remove_Null
public void Remove_Null ()
{
MembershipUserCollection muc = new MembershipUserCollection ();
muc.Remove (null);
}
示例3: Remove_ReadOnly
public void Remove_ReadOnly ()
{
MembershipUserCollection muc = new MembershipUserCollection ();
muc.Add (GetMember ("me"));
muc.SetReadOnly ();
muc.Remove ("me");
}
示例4: GetAllUsers
private MembershipUserCollection GetAllUsers(MembershipUserCollection currentuserList)
{
MembershipUserCollection userList = Membership.GetAllUsers();
MembershipUserCollection alluserList = new MembershipUserCollection();
foreach (MembershipUser user in userList)
{
if (!Roles.IsUserInRole(user.UserName, "Admin"))
{
alluserList.Add(user);
}
}
foreach (MembershipUser user in currentuserList)
{
alluserList.Remove(user.UserName);
}
return alluserList;
}