Open file ReadOnly
The process cannot access the file 'F:\Rajeev\10-11-2012\Temp\Temp\bin\Debug\Log.txt' because it is being used by another process.
TextWriterTraceListener tr = new TextWriterTraceListener(System.IO.File.CreateText("Log.txt"));
Debug.AutoFlush = true;
Debug.WriteLine("ERROR: Invalid Username " + s);
File.Open(LogFilePath, FileMode.Open, FileAccess.Read,FileShare.Read);
This is determined by the permissions the file is opened with. If a program opens the file in any type of exclusive mode, then other programs will have limited or no access.
So you can make sure you don't try to open the file exclusively (you didn't show your code). However, if you don't have the source code for the other program, then you can only hope that that program doesn't open the file exclusively. Otherwise, I don't see what you could do about it except terminate the other program.
The following code:
File.Open(LogFilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
Says that other files can also read the file that is open, but I believe they can't write to it. So if the other program was writing to the file, that would not be allowed. You could try
FileShare.ReadWrite instead but I'm still not seeing where you've indicated if you have source to the other program. Did I just miss it?