I want to make a directory within the %appdata% folder. This is what I have so far:
public MainForm() {
Directory.CreateDirectory(@"%appdata%\ExampleDirectory");
}
This does not work, but it also doesn't crash or show any errors of any kind. How would I go about doing this? I have done research, and it does work if I use the actual path:
Directory.CreateDirectory(@"C:\Users\username\AppData\Roaming\ExampleDirectory");
However, it does not work when I use the %appdata%. This is problematic as I don't know the usernames of the people using the program, so I can't use the full path.
I have also tried this:
var appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
var Example = Path.Combine(appdata, @"\Example");
Directory.CreateDirectory(Example);
And it also does not work