public static CheckFirewallAccess ( string executablePath, StringCollection baseAddresses ) : bool | ||
executablePath | string | |
baseAddresses | StringCollection | |
return | bool |
private void ApplicationAccessGrantedCK_CheckedChanged(object sender, EventArgs e) { try { if (m_application != null) { bool accessible = ConfigUtils.CheckFirewallAccess(m_application.ExecutablePath, null); if (ApplicationAccessGrantedCK.Checked) { if (!accessible) { ConfigUtils.SetFirewallAccess(m_application.ExecutablePath, null); } } else { if (accessible) { ConfigUtils.RemoveFirewallAccess(m_application.ExecutablePath, null); } } } PortsLV.Enabled = ApplicationAccessGrantedCK.Checked; AddBTN.Enabled = PortsLV.Enabled; RemoveBTN.Enabled = PortsLV.Enabled; } catch (Exception exception) { GuiUtils.HandleException(this.Text, System.Reflection.MethodBase.GetCurrentMethod(), exception); } }
/// <summary> /// Displays the dialog. /// </summary> public bool ShowDialog(ManagedApplication application) { m_application = application; if (m_application != null) { ApplicationAccessGrantedCK.Checked = ConfigUtils.CheckFirewallAccess(m_application.ExecutablePath, null); } UpdatePorts(); if (ShowDialog() != DialogResult.OK) { return(false); } return(true); }