Esempio n. 1
0
        private void GrantPortAuth_Click(object sender, EventArgs e)
        {
            NET_FW_IP_PROTOCOL_ ipProtocol;

            if (tcpOption.Checked)
            {
                ipProtocol = NET_FW_IP_PROTOCOL_.NET_FW_IP_PROTOCOL_TCP;
            }
            else
            {
                ipProtocol = NET_FW_IP_PROTOCOL_.NET_FW_IP_PROTOCOL_UDP;
            }

            firewall.GrantPortAuthorization(appPath.Text, port.Text, ipProtocol);
        }