Пример #1
0
        public FileManager(DatetimeManager datetimeManager)
        {
            Start = datetimeManager.Now();
            Index = 0;
            IConfiguration config = new ConfigurationBuilder()
                                    .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                                    .AddEnvironmentVariables()
                                    .Build();

            BaseFolder = new DirectoryInfo(config["logFolder"]);

            if (!BaseFolder.Exists)
            {
                BaseFolder.Create();
            }
            Order = 1;
        }
Пример #2
0
        public FileManager(DatetimeManager datetimeManager)
        {
            Start = datetimeManager.Now();
            IConfiguration config = new ConfigurationBuilder()
                                    .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                                    .AddEnvironmentVariables()
                                    .Build();

            ConfigFodler = config["logFolder"] ?? "logs";

            if (!Path.IsPathRooted(ConfigFodler))
            {
                ConfigFodler = Path.Combine(
                    new FileInfo(this.GetType().Assembly.Location).DirectoryName,
                    ConfigFodler);
            }

            Order = 1;
        }