Fixed Issue 224.

This commit is contained in:
Michael Möller
2011-05-22 10:41:35 +00:00
parent 7d0d8e766b
commit 40b5f8debc
+9 -2
View File
@@ -77,8 +77,15 @@ namespace OpenHardwareMonitor.Hardware {
// try to get a file in the temporary folder
try {
return Path.GetTempFileName();
} catch (IOException) { }
catch (UnauthorizedAccessException) { }
} catch (IOException) {
// some I/O exception
}
catch (UnauthorizedAccessException) {
// we do not have the right to create a file in the temp folder
}
catch (NotSupportedException) {
// invalid path format of the TMP system environment variable
}
// if this failed, we try to create one in the application folder
string fileName = Path.ChangeExtension(