Go to DotNetFunda.com
 Online : 1377 |  Welcome, Guest!   Login
 
Home > .NET Resources > Forums

  • Download the OOPS, ASP.NET and ADO.NET Training Videos for FREE, click here.

Recommend an Articles | Recommended Articles | Search Resources | Resources Home |

 Browse resources for Articles | Blogs | Forums |

Add and remove users dynamically Web.config

Author: kjell.ek | Posted on: 1/24/2010 12:05:27 PM | Views: 20
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 Post ...


Interesting?   Share and Bookmark this


Advertisement

About Us | The Team | Advertise | Contact Us | Feedback | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found copied contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
All rights reserved to DotNetFunda.Com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
(Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher)