コード例 #1
0
        // Token: 0x0600000E RID: 14 RVA: 0x00002CA0 File Offset: 0x00000EA0
        private static void RunConsole()
        {
            Console.WriteLine("Starting {0}, running in console mode.", AntispamUpdateSvc.GetAssemblyName());
            if (AntispamUpdateSvc.waitToContinue)
            {
                Console.WriteLine("Press ENTER to continue startup.");
                Console.ReadLine();
            }
            AntispamUpdateSvc service = new AntispamUpdateSvc();

            ExServiceBase.RunAsConsole(service);
        }
コード例 #2
0
        // Token: 0x0600000A RID: 10 RVA: 0x00002AC8 File Offset: 0x00000CC8
        private void TimeSliceThreadMain()
        {
            int             num                    = 0;
            AntispamUpdates antispamUpdates        = new AntispamUpdates();
            string          microsoftUpdateCabPath = AntispamUpdateSvc.GetMicrosoftUpdateCabPath();

            while (!this.timeSliceThreadShutdown.WaitOne(num, false))
            {
                try
                {
                    antispamUpdates.LoadConfiguration(string.Empty);
                    OptInStatus optInStatus = this.hygieneUpdate.SetMicrosoftUpdateOptinStatus(antispamUpdates.MicrosoftUpdate, microsoftUpdateCabPath);
                    if (optInStatus != antispamUpdates.MicrosoftUpdate)
                    {
                        antispamUpdates.MicrosoftUpdate = optInStatus;
                        antispamUpdates.SaveConfiguration(string.Empty);
                    }
                }
                catch (SecurityException ex)
                {
                    UpdateSvcEventLogger.LogEvent(AntispamUpdateServiceEventLogConstants.Tuple_MuOptFail, null, new string[]
                    {
                        ex.Message
                    });
                }
                catch (IOException ex2)
                {
                    UpdateSvcEventLogger.LogEvent(AntispamUpdateServiceEventLogConstants.Tuple_MuOptFail, null, new string[]
                    {
                        ex2.Message
                    });
                }
                catch (UnauthorizedAccessException ex3)
                {
                    UpdateSvcEventLogger.LogEvent(AntispamUpdateServiceEventLogConstants.Tuple_MuOptFail, null, new string[]
                    {
                        ex3.Message
                    });
                }
                if (antispamUpdates.MicrosoftUpdate == OptInStatus.Configured && antispamUpdates.UpdateMode == AntispamUpdateMode.Automatic)
                {
                    this.hygieneUpdate.DoUpdate();
                }
                num = AntispamUpdateSvc.pollInterval * 1000;
                if (this.hygieneUpdate.ConsoleDiagnostics)
                {
                    Console.WriteLine("Sleeping {0} Seconds", num / 1000);
                }
            }
        }
コード例 #3
0
        // Token: 0x06000007 RID: 7 RVA: 0x0000289C File Offset: 0x00000A9C
        public static void Main(string[] args)
        {
            int num = Privileges.RemoveAllExcept(new string[]
            {
                "SeAuditPrivilege",
                "SeChangeNotifyPrivilege",
                "SeCreateGlobalPrivilege"
            });

            if (num != 0)
            {
                Environment.Exit(num);
            }
            ExWatson.Register();
            AntispamUpdateSvc.runningAsService = !Environment.UserInteractive;
            bool flag = false;
            int  i    = 0;

            while (i < args.Length)
            {
                string text = args[i];
                string a;
                if ((a = text.Trim()) == null)
                {
                    goto IL_BD;
                }
                if (!(a == "-?"))
                {
                    if (!(a == "-console"))
                    {
                        if (!(a == "-wait"))
                        {
                            if (!(a == "-60"))
                            {
                                goto IL_BD;
                            }
                            AntispamUpdateSvc.pollInterval = 60;
                        }
                        else
                        {
                            AntispamUpdateSvc.waitToContinue = true;
                        }
                    }
                    else
                    {
                        flag = true;
                    }
                }
                else
                {
                    AntispamUpdateSvc.Usage();
                    Environment.Exit(0);
                }
IL_D3:
                i++;
                continue;
IL_BD:
                Console.WriteLine("{0}", text);
                AntispamUpdateSvc.Usage();
                Environment.Exit(0);
                goto IL_D3;
            }
            if (AntispamUpdateSvc.runningAsService)
            {
                ServiceBase.Run(new AntispamUpdateSvc());
                return;
            }
            if (flag)
            {
                AntispamUpdateSvc.RunConsole();
                return;
            }
            Console.WriteLine("Use the '-console' argument to run from the command line");
            AntispamUpdateSvc.Usage();
            Environment.Exit(0);
        }
コード例 #4
0
 // Token: 0x0600000D RID: 13 RVA: 0x00002C8C File Offset: 0x00000E8C
 private static void Usage()
 {
     Console.WriteLine("Usage: {0} [-console] [-wait] [-60] [-?]", AntispamUpdateSvc.GetAssemblyName());
 }