This commit is contained in:
parent
5208475a1a
commit
8ec6edeeec
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Volian.Base.Library;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
@ -36,7 +37,30 @@ namespace VEPROMS
|
||||
|
||||
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
|
||||
{
|
||||
// Roaming folders copied to the server when the user logs off the client computer in a Domain environment.
|
||||
// Windows uses the Local folder for application data that does not roam with the user. Usually this data is
|
||||
// either machine specific or too large to roam. The AppData\Local folder in Windows Vista is the same as
|
||||
// the Documents and Settings\username\Local Settings\Application Data folder in Windows XP.
|
||||
// Windows uses the Roaming folder for application specific data, such as custom dictionaries, which are
|
||||
// machine independent and should roam with the user profile. The AppData\Roaming folder in Windows Vista
|
||||
// is the same as the Documents and Settings\username\Application Data folder in Windows XP.
|
||||
// SpecialFolder.LocalApplicationData returns \Local & SpecialFolder.ApplicationData returns \Roaming
|
||||
// for example - the SpecialFolder:
|
||||
// LocalApplicationData: C:\Users\Kathy.VOLIAN0\AppData\Local
|
||||
// ApplicationData: C:\Users\Kathy.VOLIAN0\AppData\Roaming
|
||||
// CommonApplicationData: C:\ProgramData
|
||||
// MyDocuments: C:\Users\Kathy.VOLIAN0\Documents
|
||||
|
||||
// The error log is created using log4Net. The variables that were tested were:
|
||||
// <param name="File" value="${USERPROFILE}/My Documents/VE-PROMS/ErrorLog.txt" /> - puts in document directory
|
||||
// <param name="File" value="${APPDATA}/Volian/Proms2010/ErrorLog.txt" /> - puts in roaming directory
|
||||
// <param name="File" value="${LOCALAPPDATA}/Temp/VE-PROMS/ErrorLog.txt" /> - Vista - puts in local directory. !Exist for XP
|
||||
|
||||
// Decided to use 'documents directory' for error log file so that it is easily accessible by user:
|
||||
string dpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VE-PROMS\ErrorLog.txt";
|
||||
_log.Error("PROMS2010 Main ThreadException", e.Exception);
|
||||
string msg = string.Format("An error has occurred so the program will terminate. Please send the error log, {0}, to Volian.", dpath);
|
||||
MessageBox.Show(msg);
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user