示例#1
0
 public static int Main(string[] args)
 {
     if (args.Length != 0 && args[0].Equals("info", StringComparison.OrdinalIgnoreCase))
     {
         Console.WriteLine("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 will be in the future.");
         //IPBanMacApp.MacMain(args);
     }
     else
     {
         throw new PlatformNotSupportedException();
     }
     return(0);
 }
示例#2
0
 public static int ServiceEntryPoint(string[] args)
 {
     if (Console.IsInputRedirected)
     {
         return(IPBanWindowsApp.RunWindowsService(args));
     }
     else
     {
         return(IPBanWindowsApp.RunConsole(args));
     }
 }