- Home /
Question by
sapressaonenem · Mar 23 at 01:54 AM ·
folderio
how can i get the previous folder of the current folder i'm working on
hello! I needed to know how to get the folder which is the previous folder of the folder i'm currently working on (yeah, it's confusing if i put like that, but it would look something like this)
C://Games/theGame/ (that's the folder i'm working on, but i need to get the path of the previous folder, which is "Games")
C://Games/
but i'm doing this using the System.Environment.CurrentDirectory, so i don't know how to get the previous folder of this, how can i?
Comment
Answer by ster1203 · Mar 23 at 02:38 AM
var thepath = System.Environment.CurrentDirectory;
string newPath = Path.GetFullPath(Path.Combine(thepath, @"..\"));
Your answer
Follow this Question
Related Questions
Save image to resource and display 1 Answer
How do I enumerate the contents of an asset folder? 2 Answers
How do you create a folder in c#? 3 Answers
Streaming music from a folder or file 0 Answers
What is special about the _Data folder? 0 Answers