c# NetFwTypeLib, how in the firewall remove all the rules on the name of the band?



  • I only found a way to remove the rule from the exact title.

    _firewallPolicy.Rules.Remove("AdBlocker_TEST_Rule");
    

    For example, there are several rules called TestRule. How do we remove them all?



  • In you Rules list of all the rules. Choose your usual request:

    _firewallPolicy.Rules.OfType<INetFwRule>.Select...
    

    And then remove those who got into your sample.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2