本文整理匯總了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();
}