Assembly asm = Assembly.GetExecutingAssembly();
string appPath = asm.Location.Remove(asm.Location.LastIndexOf("\\")) + " \\abc.exe";
//添加启动项
RegistryKey loca = Registry.LocalMachine;
RegistryKey run = loca.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
run.DeleteValue("abc");//run.SetValue("abc", appPath);
string appPath = asm.Location.Remove(asm.Location.LastIndexOf("\\")) + " \\abc.exe";
//添加启动项
RegistryKey loca = Registry.LocalMachine;
RegistryKey run = loca.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
run.DeleteValue("abc");//run.SetValue("abc", appPath);