private void btnViewErrorLogFile_Click(object sender, EventArgs e)
{
errorLogFileProcess = Process.Start(AppVars.ErrorLogFilePath);
}
The above opens a text file in notepad. It contains error logs for my application.
I do not want to allow the user to open multiples of this file. So I do not want to have him/her click the button again and open another window of the same file.
How do I check if this file is open? Note: I DO NOT want to close a (or all) notepad.exe processes because the user might have a notepad process open for something else other than my application file (which uses notepad.exe when the file is open).
So again, how do I go about checking whether the process I opened is already opened?