RegistryKey rkStartUp = Registry.CurrentUser;
RegistryKey StartupPath;
StartupPath =rkStartUp.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
if (StartupPath.GetValue("MyApplication") == null)
{
StartupPath.SetValue("MyApplication", Application.ExecutablePath, RegistryValueKind.ExpandString);
}
else
{
StartupPath.DeleteValue("MyApplication", true);
}
问问题
211 次