我使用WebSecurity创建用户的帐户。
var confirmationToken = WebSecurity.CreateUserAndAccount(model.Username, model.Password,
new { Email = model.Email,
Lastname = model.Lastname,
Firstname = model.Firstname,
Birthday = model.Birthday,
Job = model.Job,
City = model.City,
Gender = model.Gender,
PictureFilename = "anonyme.png"
}, true);
但我该如何删除用户?
答案 0 :(得分:10)
((SimpleMembershipProvider)Membership.Provider).DeleteAccount(userName); // deletes record from webpages_Membership table
((SimpleMembershipProvider)Membership.Provider).DeleteUser(userName, true); // deletes record from UserProfile table