2

how to check whether the directory in a given path is open or not.. if it is in open then how to close it.. when i trying to delete and recreate the directory and am getting the below error when my PreviewSerialization directory is in open state. the exception is thrown at Directory.Delete method

if (Directory.Exists(filepath))
        {             
            Directory.Delete(filepath, true);              
        }          
        Directory.CreateDirectory(filepath);

Could not find a part of the path 'C:\Users\surya.panchanathan\AppData\Roaming\take123\DD\1.0.0.0\**PreviewSerialization\'.**

TIA

surya
  • 191
  • 1
  • 8

0 Answers0