You have to check if you can open the file exclusively:
FileStream stream = null;
bool isInUse = false;
try
{
using (stream = File.Open(FolderAndFileName, FileMode.Open, FileAccess.Write, FileShare.None))
{
isInUse = !stream.CanWrite;
}
}
catch (Exception err)
{
isInUse = true;
}