Exemple #1
0
        public static void DisableFirewall()
        {
            var arg = DisableFirewallCommand();

            ProcessHandlerAsync.RunAsync("cmd.exe", arg,
                                         output => { Debug.WriteLine(output); },
                                         error => { Debug.WriteLine(error); })
            .GetAwaiter()
            .OnCompleted(() => { Debug.WriteLine("done"); });
        }
Exemple #2
0
        public static void ClosePort(this int port, string name, ENUM_PORT_TYPE portType,
                                     ENUM_BOUND_TYPE boundType)
        {
            var arg = ClosePortCommand(name, boundType.ToString(), portType.ToString(), port);

            ProcessHandlerAsync.RunAsync("cmd.exe", arg,
                                         output => { Debug.WriteLine(output); },
                                         error => { Debug.WriteLine(error); })
            .GetAwaiter()
            .OnCompleted(() => { Debug.WriteLine("done"); });
        }