Closed reyaz006 closed 10 years ago
No easy way to do this as this is the behaviour of .Net configuration.
Then maybe implement a function to wipe all settings from within the app?
For reference
ConfigurationUserLevel[] options = { ConfigurationUserLevel.PerUserRoaming, ConfigurationUserLevel.PerUserRoamingAndLocal };
foreach (var item in options)
{
var config = ConfigurationManager.OpenExeConfiguration(item);
if (File.Exists(config.FilePath))
{
Debug.WriteLine(config.FilePath);
// Delete the folder where app.config resides, e.g. /Nandaka/NijieDownloader_xxxx/
new FileInfo(config.FilePath).Directory.Parent.Delete(true);
try
{
// Delete the root folder, e.g. /Nandaka/.. if empty
new FileInfo(config.FilePath).Directory.Parent.Parent.Delete(false);
}
catch (Exception ex) { Debug.WriteLine(ex.Message); }
}
}
Properties.Settings.Default.Reload();
Because when a full reset is needed, having to go to
C:\Users\User\AppData\Local\Nandaka\NijieDownloader.UI.exe_Url_tonsofrandomsymbols\1.0.1.0
is not very comfortable. This should also make the app fully portable.