Esempio n. 1
0
        public void DeleteEntry(IpSetEntry entry)
        {
            String command = entry.GetFullCommand("del");

            if (InTransaction)
            {
                _transactionCommands.Add(command);
            }
            else
            {
                var process = _system.StartProcess(BinaryName, command);
                process.WaitForExit();

                if (process.ExitCode != 0)
                {
                    throw new IpTablesNetException(String.Format("Failed to delete entry: {0}",
                                                                 process.StandardError.ReadToEnd()));
                }
            }
        }
        public void DeleteEntry(IpSetEntry entry)
        {
            String command = entry.GetFullCommand("del");

            if (InTransaction)
            {
                _transactionCommands.Add(command);
            }
            else
            {
                using (var process = _system.StartProcess(BinaryName, command))
                {
                    String output, error;
                    ProcessHelper.ReadToEnd(process, out output, out error);

                    if (process.ExitCode != 0)
                    {
                        throw new IpTablesNetException(String.Format("Failed to delete entry: {0}", error));
                    }
                }
            }
        }
Esempio n. 3
0
        public void DeleteEntry(IpSetEntry entry)
        {
            String command = entry.GetFullCommand("del");

            if (InTransaction)
            {
                _transactionCommands.Add(command);
            }
            else
            {
                var process = _system.StartProcess(BinaryName, command);
                process.WaitForExit();

                if (process.ExitCode != 0)
                {
                    throw new IpTablesNetException(String.Format("Failed to delete entry: {0}",
                        process.StandardError.ReadToEnd()));
                }
            }
        }
        public void DeleteEntry(IpSetEntry entry)
        {
            String command = entry.GetFullCommand("del");

            if (InTransaction)
            {
                _transactionCommands.Add(command);
            }
            else
            {
                using (var process = _system.StartProcess(BinaryName, command))
                {
                    String output, error;
                    ProcessHelper.ReadToEnd(process, out output, out error);

                    if (process.ExitCode != 0)
                    {
                        throw new IpTablesNetException(String.Format("Failed to delete entry: {0}", error));
                    }
                }
            }
        }