I would use System.IO.Path.Combine(...)
instead of string.Conact(...)
in this situation. Like this...
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Programım");
The result of path
in your original code might not be what you are actually expecting.
Once you are sure your path
value is correct then call System.IO.Directory.Delete(...)
like...
Directory.Delete(path, true);
If that still is not working, then there may be some other security permission problems with files in that directory, or with the directory itself. See the MSDN page for all of the exceptions that can be thrown from the Delete
method and the reasons why.