Hi Ron,
I hope that these chunk resolve the problem.
public static Process RunningInstance()
{
Process current = Process.GetCurrentProcess();
Process[] processes = Process.GetProcessesByName(current.ProcessName);
foreach (Process process in processes)
{
if (process.Id != current.Id)
{
if (Assembly.GetExecutingAssembly().Location.
Replace("/", "\\") == current.MainModule.FileName)
{
return process;
}
}
}
return null;
}
if (Form1.RunningInstance() != null)
{
MessageBox.Show("Duplicate Instance");
Form1.RunningInstance().Kill();
}
else
{
RunningInstance();
}
Thanks
Mohit