AuthorizationRuleCollection.Remove(AuthorizationRule) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从 AuthorizationRule 集合中删除对象。
public:
void Remove(System::Web::Configuration::AuthorizationRule ^ rule);
public void Remove(System.Web.Configuration.AuthorizationRule rule);
member this.Remove : System.Web.Configuration.AuthorizationRule -> unit
Public Sub Remove (rule As AuthorizationRule)
参数
- rule
- AuthorizationRule
要 AuthorizationRule 删除的对象。
例外
集合中不存在传递 AuthorizationRule 的对象、已删除元素或集合是只读的。
示例
下面的代码示例演示如何使用 Remove 该方法。 请参阅类主题中的 AuthorizationSection 代码示例,了解如何获取集合。
// Remove the rule from the collection.
authorizationSection.Rules.Remove(authorizationRule);
' Remove the rule from the collection.
authorizationSection.Rules.Remove(authorizationRule)
注解
此方法将元素插入 remove 到配置文件的相应节中,用于在较高级别的配置文件中定义的任何元素。 如果元素在当前配置文件的相应节中定义,则会从配置文件中删除其条目。 要删除的对象必须存在于集合中。