mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-24 04:53:08 +00:00
25 lines
639 B
C#
25 lines
639 B
C#
|
using System.Configuration;
|
|||
|
using System.IO;
|
|||
|
|
|||
|
namespace PKHeX.WinForms
|
|||
|
{
|
|||
|
public static class ConfigUtil
|
|||
|
{
|
|||
|
public static bool checkConfig()
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
|
|||
|
return true;
|
|||
|
}
|
|||
|
catch (ConfigurationErrorsException e)
|
|||
|
{
|
|||
|
string path = (e.InnerException as ConfigurationErrorsException)?.Filename;
|
|||
|
if (path != null)
|
|||
|
File.Delete(path);
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|