Here\'s what I have in mind:
var file = @\"myfile\";
File.Open(file,
FileMode.Open, FileAccess.ReadWrite, FileShare.None);
Well, if the file is totally locked (no sharing) you will not be able to read it. If the file was opened to share read, you will be able to read using a non intrusive method:
string fileName = @"myfile";
using (FileStream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
using (StreamReader fileReader = new StreamReader(fileStream ))
{
while (!fileReader .EndOfStream)
{
string line = fileReader .ReadLine();
// Your code here
}
}