110,545
社区成员
发帖
与我相关
我的任务
分享
/// <summary>
/// 注册表操作,将程序添加到启动项
/// </summary>
static void SetRegistryKey()
{
try
{
Microsoft.Win32.RegistryKey Reg;
Reg = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true);
Reg.SetValue("储存的名字", Application.ExecutablePath);
Reg.Close();
}
catch { }
}