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


C# SiteUser.DeleteUser方法代碼示例

本文整理匯總了C#中mojoPortal.Business.SiteUser.DeleteUser方法的典型用法代碼示例。如果您正苦於以下問題:C# SiteUser.DeleteUser方法的具體用法?C# SiteUser.DeleteUser怎麽用?C# SiteUser.DeleteUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mojoPortal.Business.SiteUser的用法示例。


在下文中一共展示了SiteUser.DeleteUser方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DeleteUser

        public override bool DeleteUser(string userName, bool deleteAllRelatedData)
        {
            /*
             * 	Takes, as input, a user name and deletes that user from the membership data source. DeleteUser returns
             * true if the user was successfully deleted. Otherwise, it returns false. DeleteUser takes a third parameter-a Boolean
             * named deleteAllRelatedData-that specifies whether related data for that user should be deleted also.
             * If deleteAllRelatedData is true, DeleteUser should delete role data, profile data, and all other data associated
             * with that user.
             */
            bool result = false;
            SiteSettings siteSettings = GetSiteSettings();
            // we are ignoring deleteAllRelatedData
            // on purpose because whether to really delete or just flag as deleted
            // is determined by the siteSettings.ReallyDeleteUsers setting

            if ((userName != null) && (siteSettings != null))
            {
                SiteUser siteUser = new SiteUser(siteSettings, userName);
                if (siteUser.UserId > -1)
                {
                    result = siteUser.DeleteUser();

                }
            }

            return result;
        }
開發者ID:joedavis01,項目名稱:mojoportal,代碼行數:27,代碼來源:mojoMembershipProvider.cs


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