How to navigate a few folders up?

Other simple way is to do this:

string path = @"C:\Folder1\Folder2\Folder3\Folder4";
string newPath = Path.GetFullPath(Path.Combine(path, @"..\..\"));

Note This goes two levels up. The result would be:
newPath = @"C:\Folder1\Folder2\";

Additional Note
Path.GetFullPath normalizes the final result based on what environment your code is running on windows/mac/mobile/…

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)