Hello , I have the problem connected to my programm , I use C# , and code is like this :
Directory.CreateDirectory(path); // this one works well , but in the same form on the button click event i have code below
File.CreateText(path1); // this creates text file then i close this
File.CreateText(path1); // and after debugging it throws exeption saying that it's used by another process
but it also creates folder on path and text file on path1 . without Visual Studio when i rum programm it throws exception , but text file and folder in which it's located is created .
I want not to throw exception . and user get able to use program without any exception or mistake .
thank in advance