WPF 设置程序开机自动运行(+注册表项)
#region 设置程序开机自动运行(+注册表项) RegistryKey rgkRun = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); if (rgkRun == null) { rgkRun = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"); } rgkRun.SetValue(exeInfo.ProductName, exePath); #endregion
"唯有高屋建瓴,方可水到渠成"