try { using (FileStream fs = File.Open("FileName", FileMode.Open, FileAccess.ReadWrite, FileShare.None)) { //File copy } } catch (Exception) { // File is in use. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)