static void Main(string[] args) { System.AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper; System.AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; if (args.Length > 0) { foreach (var arg in args) { var upArg = arg.ToUpper(); int threads; bool isNum = int.TryParse(upArg, out threads); if (isNum) { ParseThreadArg(threads); } else { ParseLogArg(upArg); } } } Logging.Debug("Launching scan..."); MultiThreadScanner.StartScan(pingThreads); Logging.Debug("Passed scan call..."); Environment.Exit(0); }
static void Run(Options options) { // Process options. ParseThreadArg(options.Threads); ParseLogArg(options.LogLevel); if (options.MaxEntries > 0) { _maxEntries = options.MaxEntries; } Logging.Debug("Launching scan..."); MultiThreadScanner.StartScan(_pingThreads, _maxEntries); Logging.Debug("Passed scan call..."); Environment.Exit(0); }