vendredi 27 mars 2015

Registry Key can't load program using c# .net


Vote count:

0




I've created a program connecting to a database and in MDIForm I put up with this code so that during start up the program will automatically run. My problem is during run-time or after booting my laptop there's and error pops-up and I was confused why because error states there that the setup of my database is not in valid path but when I run in manual mode in which the debug file located there's no error and works fine, but during start up program using with this code below it runs an run time error. What's wrong with using this code below?



RegistryKey _reg = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);

public MainMDI()
{
_reg.SetValue("SampleApp", Application.ExecutablePath.ToString());
InitializeComponent();
}


asked 16 secs ago

Lee

2






Registry Key can't load program using c# .net

Aucun commentaire:

Enregistrer un commentaire