Small line of code can make our application auto run after windows startup.
using Microsoft.Win32;
void setasStartup(bool res)
{
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
if (res == true)
{
registryKey.SetValue("URL_watcher", Application.ExecutablePath);
}
else
{
registryKey.DeleteValue("URL_watcher");
}
}
using Microsoft.Win32;
void setasStartup(bool res)
{
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
if (res == true)
{
registryKey.SetValue("URL_watcher", Application.ExecutablePath);
}
else
{
registryKey.DeleteValue("URL_watcher");
}
}