From 3e65f5bfc287741c7f3b929e86585e51a1cae061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Tue, 5 Oct 2010 19:27:51 +0000 Subject: [PATCH] Fixed Issue 125. --- GUI/MainForm.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/GUI/MainForm.cs b/GUI/MainForm.cs index 30eff2d..1084409 100644 --- a/GUI/MainForm.cs +++ b/GUI/MainForm.cs @@ -350,8 +350,15 @@ namespace OpenHardwareMonitor.GUI { settings.SetValue("treeView.Columns." + column.Header + ".Width", column.Width); - settings.Save(Path.ChangeExtension( - System.Windows.Forms.Application.ExecutablePath, ".config")); + string fileName = Path.ChangeExtension( + System.Windows.Forms.Application.ExecutablePath, ".config"); + try { + settings.Save(fileName); + } catch (UnauthorizedAccessException) { + MessageBox.Show("Access to the path '" + fileName + "' is denied. " + + "The current seetings could not be saved.", + "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } private void MainForm_FormClosed(object sender, FormClosedEventArgs e) {