Exemplo n.º 1
0
        public static int Main(string[] args)
        {
            IPBanExtensionMethods.RequireAdministrator();

            if (args.Length != 0 && args[0].Equals("info", StringComparison.OrdinalIgnoreCase))
            {
                IPBanLog.Warn("System info: {0}", IPBanOS.OSString());
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                IPBanWindowsApp.WindowsMain(args);
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                IPBanLinuxApp.LinuxMain(args);
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                throw new PlatformNotSupportedException("Mac OSX is not yet supported, but may be in the future.");
                //IPBanMacApp.MacMain(args);
            }
            else
            {
                throw new PlatformNotSupportedException();
            }
            return(0);
        }
Exemplo n.º 2
0
 public static int ServiceEntryPoint(string[] args)
 {
     if (Console.IsInputRedirected)
     {
         return(IPBanWindowsApp.RunWindowsService(args));
     }
     else
     {
         return(IPBanWindowsApp.RunConsole(args));
     }
 }