Author: kjell.ek | Posted on: 1/24/2010 12:05:27 PM | Views : 291

How do I delete a user I added dynamically from a web application? If i want to delete user/string "<allow users="peter" />"

I can add a user like this (below), but not delete a user....
Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration("~", Nothing, "admin", "") Dim section As AuthorizationSection = CType(config.GetSection("system.web/authorization"), AuthorizationSection) Dim rule As New AuthorizationRule(AuthorizationRuleAction.Allow) rule.Users.Add(tbUser.Text) section.Rules.Add(rule) config.Save()
 
...

Go to the complete details ...