當前位置: 首頁>>代碼示例>>C#>>正文


C# User.delete方法代碼示例

本文整理匯總了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;
 }
開發者ID:Jeavon,項目名稱:Umbraco-CMS,代碼行數:21,代碼來源:UsersMembershipProvider.cs

示例2: User_Delete_Admin_Not_Allowed

 public void User_Delete_Admin_Not_Allowed() 
 {
     User u = new User(0);
     u.delete();
 }
開發者ID:elrute,項目名稱:Triphulcas,代碼行數:5,代碼來源:UserTest.cs


注:本文中的umbraco.BusinessLogic.User.delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。