i am new to C# how can i set file path to project files
i have tried these but it gives default windows file path how to do that?
sfdlg.InitialDirectory = Application.StartupPath + @"..\..\";
Application.StartupPath---> is my excutable file path. from this path to come back two `root folders` i use `@"..\..\"`
is there any way to get back to Two root folders?
You have inverted the path specifications – the
..should be at the start of the path (assuming no drive name is there).A safe way to use paths is to use them with the
Pathclass:The above should do the trick.