Rules.Add Method

Tungsten Suite

RulesAdd Method

Adds a rule to the firewall

Namespace:  W.Firewall
Assembly:  Tungsten.Firewall (in Tungsten.Firewall.dll) Version: 2.0.0
Syntax
C#
public static void Add(
	string ruleName,
	string ruleGroup,
	int protocol = 6,
	string localPorts = "80",
	RulesEFirewallRuleAction action = RulesEFirewallRuleAction.Allowed,
	RulesEFirewallProfiles profiles = RulesEFirewallProfiles.All
)

Parameters

ruleName
Type: SystemString
The name of the rule to add
ruleGroup
Type: SystemString
The group under which the rule is added
protocol (Optional)
Type: SystemInt32
The desired rule protocol
localPorts (Optional)
Type: SystemString
The desired rule port
action (Optional)
Type: W.FirewallRulesEFirewallRuleAction
The desired rule action, to allow or block communications
profiles (Optional)
Type: W.FirewallRulesEFirewallProfiles
The desired rule profile
See Also