Multiple running instances of TBF program tested.
This commit is contained in:
@@ -66,6 +66,14 @@ namespace TBF
|
||||
Version = string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build);
|
||||
BuildDateTime = new System.IO.FileInfo(thisAssembly.Location).LastWriteTime;
|
||||
|
||||
/// Check if another instance is running
|
||||
string processName = System.IO.Path.GetFileNameWithoutExtension(thisAssembly.Location);
|
||||
if (System.Diagnostics.Process.GetProcessesByName(processName).Length > 1)
|
||||
{
|
||||
MessageBox.Show(Strings.Another_instance_is_running, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||
return;
|
||||
}
|
||||
|
||||
/// Local program configuration directory including the trailing backslash
|
||||
string locAppDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
|
||||
Path.DirectorySeparatorChar + "TestBenchFramework" + Path.DirectorySeparatorChar;
|
||||
|
||||
Reference in New Issue
Block a user