tryston02,
Not the most graceful solution, but here are two ways to accomplish this:
string folder = Application.StartupPath;
if (folder.ToLower().EndsWith(@"\debug"))
folder = folder.Substring(0, folder.Length - @"\Debug".Length);
if (folder.ToLower().EndsWith(@"\bin"))
folder = folder.Substring(0, folder.Length - @"\bin".Length);
string filepath = Path.Combine(folder, "SyncSettings.xml");
//-----
string anotherfilepath = Path.Combine(Application.StartupPath, @"..\..\SyncSettings.xml");
Cheers.
- Roger Nedel
|