62,046
社区成员
发帖
与我相关
我的任务
分享
[HttpGet]
public bool Login(string UserName, string Password)
{
bool ret = WebSecurity.Login(UserName, Password, persistCookie: true);
if (ret)
{
var role = new SimpleRoleProvider();
if (!role.IsUserInRole(UserName, "VIP"))//这里出错这里出错这里出错
{
role.AddUsersToRoles(new string[] { UserName }, new string[] { "VIP" });
}
}
return ret;
}