private static void CheckDefaultConfig()
{
if (!File.Exists(configPath) || string.IsNullOrWhiteSpace(File.ReadAllText(configPath)))
{
try
{
using (StreamWriter sw = File.CreateText(configPath))
sw.WriteLine("[" + configSection + "]");
}
catch (DirectoryNotFoundException)
{
Directory.CreateDirectory(Path.GetDirectoryName(configPath));
}
finally
{
using (StreamWriter sw = File.CreateText(configPath))
sw.WriteLine("[" + configSection + "]");
}
foreach (KeyValuePair<string, string> kvp in Default)
Write(kvp.Key, kvp.Value);
}
}