public static SetFirewallAccess ( Opc application, string executablePath ) : void | ||
application | Opc | |
executablePath | string | |
return | void |
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); } }
private void AddTN_Click(object sender, EventArgs e) { try { int port = new NewPortDlg().ShowDialog(0); if (port > 0) { ConfigUtils.SetFirewallAccess(m_application.ExecutablePath, port); UpdatePorts(); } } catch (Exception exception) { GuiUtils.HandleException(this.Text, System.Reflection.MethodBase.GetCurrentMethod(), exception); } }
void Port_CheckedChanged(object sender, EventArgs e) { try { CheckBox box = (CheckBox)sender; if (box.Checked) { ConfigUtils.SetFirewallAccess(m_application.ExecutablePath, (int)box.Tag); } else { ConfigUtils.RemoveFirewallAccess((int)box.Tag); } UpdatePorts(); } catch (Exception exception) { GuiUtils.HandleException(this.Text, System.Reflection.MethodBase.GetCurrentMethod(), exception); } }