and thank you for taking your time to help me.
I have an app that I'm adding to startup in registry with the code:
RegistryKey setRunAtStartup = Registry.LocalMachine.OpenSubKey ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
setRunAtStartup.SetValue("mls", Application.ExecutablePath.ToString());
And I also have a ini.xml file that needs to be in the same folder as my app. So I access it in this manner:
XmlDocument doc = new XmlDocument();
doc.Load(Application.StartupPath.ToString() + "/ini.xml");
The problem is, after rebooting computer Application.StartupPath is no longer returning my old path but returns C:\Windows\System32\myapp.exe, thus it throws an exception: cannot find the needed ini.xml in that folder. How can I fix this? I need a method that will return REAL path in order to access my ini.xml. Thank you!