| 以下为引用的内容: <roleManager enabled="true"/> <authorization> <allow roles="admin"/> <deny users="*"/> </authorization> |
| 以下为引用的内容: if(!Roles.RoleExists("admin")) Roles.CreateRole("admin"); |
| 以下为引用的内容: FormsAuthentication.SetAuthCookie (tb_username.Text, false); if(!Roles.IsUserInRole (tb_username.Text,"admin")) Roles.AddUserToRole (tb_username.Text, "admin"); Response.Redirect (FormsAuthentication.GetRedirectUrl (tb_username.Text, false)); |