扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
图1.ASP.NET 2.0安全提供者模型 |
[Serializable] public class MembershipUser{ public virtual bool ChangePassword(string oldPassword,string newPassword); public virtual string GetPassword(string passwordAnswer); public virtual string ResetPassword(string passwordAnswer); public virtual bool UnlockUser(); //其它成员 } public static class Membership{ public static string ApplicationName{get;set;} public static MembershipUser CreateUser(string username, string password); public static MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, out MembershipCreateStatus status); public static bool DeleteUser(string username,bool deleteAllRelatedData); public static MembershipUser GetUser(string username); public static void UpdateUser(MembershipUser user); public static bool ValidateUser(string username,string password); public static bool EnablePasswordReset{get;} public static bool EnablePasswordRetrieval{get;} //其它成员 } |
Membership.ApplicationName = "MyApp"; Membership.CreateUser("MyUser","MyPassword",...); |
public static class Roles{ public static string ApplicationName{get;set;} public static void CreateRole(string roleName); public static bool DeleteRole(string roleName, bool throwOnPopulatedRole); public static void AddUserToRole(string username, string roleName); public static void RemoveUserFromRole(string username, string roleName); public static string[] GetAllRoles(); public static string[] GetRolesForUser(string username); public static string[] GetUsersInRole(string roleName); public static bool IsUserInRole(string username, string roleName); //其它成员 } |
Roles.ApplicationName = "MyApp"; Roles.CreateRole("Manager"); |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者