I have created a WindowsApp.exe under Application\Setup folder. Now I want to create a Database under Application\Database folder from WindowsApp.exe
What should be the path given to the filename here?
I have created a WindowsApp.exe under Application\Setup folder. Now I want to create a Database under Application\Database folder from WindowsApp.exe
What should be the path given to the filename here?
try
Path.Combine(Environment.CurrentDirectory, "Database\\db1.mdb")
Edit
since you want the parent folder you can go up one folder by doing
Path.Combine(Environment.CurrentDirectory.Substring(Environment.CurrentDirectory.LastIndexOf("\\")), "Database\\db1.mdb")
Edit 2
if you want the Application folder even if its N times above the current folder then you can reach it by doing this
var index = Environment.CurrentDirectory.IndexOf(Environment.CurrentDirectory.IndexOf("ApplicationRootFolderName"),"\\")
var AppRootPath = Environment.CurrentDirectory.Substring(0,index);
Edit 3
As mentioned by Michael its better to get the parent folder using this way
Directory.GetParent(Environment.CurrentDirectory).FullName