C#如何实现程序开机自动运行?

2025-03-04 11:10:09
推荐回答(1个)
回答1:

那还不容易!using system .microsoft.win32;//一定要引用
RegistryKey rk = Registry.LocalMachine;
RegistryKey rk2 = rk.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run");
rk2.SetValue( "autorun",这写程序路径);
rk2.Close();
rk.Close();