Exemplo n.º 1
0
Arquivo: Idpe.cs Projeto: eyedia/idpe
 public string ClearLog()
 {
     ExtensionMethods.TraceInformation("Cleaing log!");
     Trace.Flush();
     SetupTrace.Clear(Information.EventLogSource, Information.EventLogName);
     ExtensionMethods.TraceInformation("New log created.");
     Trace.Flush();
     return("true");
 }
Exemplo n.º 2
0
        void HandleQueryParams(HttpContext context)
        {
            if (context.Request.QueryString["pullers"] != null)
            {
                switch (context.Request.QueryString["pullers"])
                {
                case "0":
                    new Idpe().StartPullers();
                    break;

                case "1":
                    new Idpe().StopPullers();
                    break;

                case "2":
                    Idpe psc = new Idpe();
                    psc.StopPullers();
                    psc.StartPullers();
                    break;
                }
            }
            if (context.Request.QueryString["log"] != null)
            {
                switch (context.Request.QueryString["log"])
                {
                case "1":
                    //Registry.Instance.ClearLog();
                    SetupTrace.Clear(Information.EventLogSource, Information.EventLogName);
                    break;
                }
            }

            if (context.Request.QueryString["cache"] != null)
            {
                var configuration = WebConfigurationManager.OpenWebConfiguration("~");
                EyediaCoreConfigurationSection coreConfig = (EyediaCoreConfigurationSection)configuration.GetSection("eyediaCoreConfigurationSection");
                coreConfig.Cache = context.Request.QueryString["cache"] == "1" ? true : false;
                configuration.Save();
            }

            if (context.Request.QueryString["logname"] != null)
            {
                _ArchiveLogRelativePath = context.Request.QueryString["logname"];
            }
        }