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); } }
/// <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)); }
/// <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); }