lundi 11 mai 2015

c# file not found exeption after app starts on startup

I have problem with my app. When i run it by myself all works perfect. But when my app start from startup I have System.IO.FileNotFoundException. I add my app on startup by following code:

RegistryKey wowNode = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Run", true);

wowNode.SetValue("myApp", System.Reflection.Assembly.GetEntryAssembly().Location);

and when my app start after reboot I have System.IO.FileNotFoundException all files are in the same directory with .exe file

Can someone help me with this?

code I use for read file:

names = File.ReadAllLines("name.txt");

Aucun commentaire:

Enregistrer un commentaire