public bool FileIsLocked(string strFullFileName) { bool blnReturn = false; System.IO.FileStream fs; try { fs = System.IO.File.Open(strFullFileName, IO.FileMode.OpenOrCreate, IO.FileAccess.Read, IO.FileShare.None); fs.Close(); } catch (System.IO.IOException ex) { blnReturn = true; } return blnReturn; }
Himanshu Manjarawala Sr. Software Engineer@AutomationAnywhere http://fieredotnet.wordpress.com/
Thanks, Sanjay
Login to post response