Issue with Environment.SpecialFolder.MyDocuments
-
I am having an issue with this. I need to create a folder in the current users application data folder to store settings but I cannot. Every time I try to use Directory.CreateDirectory(Environment.SpecialFolder.MyDocuments + "/JFE/Settings") Or anything else under SpecialFolder it will just create a folder in the application's directory with a name like Personal then inside this directory it will make the folders I requested. Why does it do this? I printed out the string for the special folder and looked at it and it is correct but for some reason it creates my folders in the current program's directory.
Y*Live Long And Prosper*Y
-
I am having an issue with this. I need to create a folder in the current users application data folder to store settings but I cannot. Every time I try to use Directory.CreateDirectory(Environment.SpecialFolder.MyDocuments + "/JFE/Settings") Or anything else under SpecialFolder it will just create a folder in the application's directory with a name like Personal then inside this directory it will make the folders I requested. Why does it do this? I printed out the string for the special folder and looked at it and it is correct but for some reason it creates my folders in the current program's directory.
Y*Live Long And Prosper*Y
Try this:
Directory.CreateDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "JFE/Settings"))
Good luck PS: The big change is Environment.GetFolderPath. Path.Combine I just inserted because it's better to use that than concatenate the path using "+"
-
Try this:
Directory.CreateDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "JFE/Settings"))
Good luck PS: The big change is Environment.GetFolderPath. Path.Combine I just inserted because it's better to use that than concatenate the path using "+"
Worked! Thanks!
Y*Live Long And Prosper*Y
-
Worked! Thanks!
Y*Live Long And Prosper*Y