本文整理汇总了C#中umbraco.BusinessLogic.User.delete方法的典型用法代码示例。如果您正苦于以下问题:C# User.delete方法的具体用法?C# User.delete怎么用?C# User.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类umbraco.BusinessLogic.User
的用法示例。
在下文中一共展示了User.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteUser
/// <summary>
/// Removes a user from the membership data source.
/// </summary>
/// <param name="username">The name of the user to delete.</param>
/// <param name="deleteAllRelatedData">true to delete data related to the user from the database; false to leave data related to the user in the database.</param>
/// <returns>
/// true if the user was successfully deleted; otherwise, false.
/// </returns>
public override bool DeleteUser(string username, bool deleteAllRelatedData)
{
try
{
User user = new User(username);
user.delete();
}
catch (Exception)
{
return false;
}
return true;
}
示例2: User_Delete_Admin_Not_Allowed
public void User_Delete_Admin_Not_Allowed()
{
User u = new User(0);
u.delete();
}