
![]() 图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"); |
| 关于我们 | 联系我们 | 广告服务 | 工作机会 | 版权声明 | 欢迎投稿 | 网站地图 |
| Copyright © 2000-2008 , www.21tx.com , All Rights Reserved . |
| © 晨新科技 版权所有 Created by TXSite.net |