Ejemplo n.º 1
0
        public void Load(BinaryReader reader)
        {
            // Clear current configuration
            Profiles.Clear();

            // Get number of profiles
            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                // Get firewall profile
                FirewallProfile profile = FirewallProfile.Parse(reader);

                // If profile has no scored properties, skip
                if (profile.Properties.Count == 0)
                {
                    continue;
                }

                // Add profile to list
                Profiles.Add(profile);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Enable Firewall profile
 /// </summary>
 /// <param name="profile"><see cref="FirewallProfile"/></param>
 /// <returns>true if profile(s) is enabled</returns>
 public bool EnableFirewallProfile(FirewallProfile profile, bool allowInBound = false)
 {
     return(CtcUtility.EnableFirewallProfile(profile, allowInBound));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Disable Firewall profile
 /// </summary>
 /// <param name="profile"><see cref="FirewallProfile"/></param>
 /// <returns>true if profile(s) is disabled</returns>
 public bool DisableFirewallProfile(FirewallProfile profile)
 {
     return(CtcUtility.DisableFirewallProfile(profile));
 }
 public static bool Enable(FirewallProfile profile)
 {
     checkForAdminRights();
     if (profile == FirewallProfile.All) throw new ArgumentException("The 'All' profile can't used for enabling");
     return FirewallPolicy.Instance.Enable(profile);
 }