コード例 #1
0
        public App()
        {
            Log.Logger = new LoggerConfiguration()
                         .WriteTo.Console()
                         .WriteTo.File("log-.txt", rollingInterval: RollingInterval.Day)
                         .CreateLogger();

            Log.Information("Logger Loaded");

            if (!Directory.Exists(SettingsFileRootDir + SettingsFileAppDir))
            {
                try
                {
                    Directory.CreateDirectory(SettingsFileRootDir + SettingsFileAppDir);
                }
                catch (Exception)
                {
                }
            }
            try
            {
                Settings = ApplicationSettings_Serializer.Load(SettingsFilePath);
            }
            catch (Exception)
            {
                Settings = new ApplicationSettings_Serializer.ApplicationSettings();
            }
        }
コード例 #2
0
 public App()
 {
     if (!Directory.Exists(SettingsFileRootDir + SettingsFileAppDir))
     {
         try
         {
             Directory.CreateDirectory(SettingsFileRootDir + SettingsFileAppDir);
         }
         catch (Exception)
         {
         }
     }
     try
     {
         Settings = ApplicationSettings_Serializer.Load(SettingsFilePath);
     }
     catch (Exception)
     {
         Settings = new ApplicationSettings_Serializer.ApplicationSettings();
     }
 }