Пример #1
0
 public Driver(OnNetDownConfig config)
 {
     Config                    = config;
     Inspector                 = new NetStatusInspector(config.NetworkInterfaceName);
     NetDownCommandRunner      = new CommandRunner(config.Shell, config.OnNetDownCommand);
     UnknownErrorCommandRunner = new CommandRunner(config.Shell, config.OnNetDownCommand);
 }
Пример #2
0
        static void Main(string[] args)
        {
            var config = new OnNetDownConfig("App.config");

            try
            {
                var driver = new Driver(config);
                driver.Drive();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                using (var sw = new StreamWriter(config.LogFile))
                {
                    sw.WriteLine(ex.ToString());
                }
            }
        }