Answer the question
In order to leave comments, you need to log in
What's wrong with autorun?
The code:
string ExePath = System.Windows.Forms.Application.ExecutablePath;
if (String.IsNullOrEmpty((String)Registry.CurrentUser.GetValue(wigetName)))
{
RegistryKey reg = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run\");
reg.SetValue(wigetName, ExePath);
reg.Close();
}
Answer the question
In order to leave comments, you need to log in
I found the problem, the bottom line is that for some reason the program stopped throwing exceptions, but simply crashes and closes immediately after autorun due to an error, although I did not handle these exceptions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question