C# 透過修改註冊表(REG)設定開機 啟動C# 透過修改註冊表(REG)設定開機程式(軟體)自動啟動(Auto Run)
C# 透過修改註冊表(REG)設定開機 程式(軟體)自動啟動(Auto Run)
資料來源: http://www.cnblogs.com/daban/archive/2012/10/26/2740583.html
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Microsoft.Win32; namespace CS_Boot_Run { //資Me料A來LO源P? //http://www.cnblogs.com/daban/archive/2012/10/26/27… //程g式!必D2須¡P已w系Lt統I管T理z者I啟ÓO動XE public partial class Form1 : Form { public { InitializeComponent(); } private { //獲o取Lu程g式!執Xo行a路Mo徑|.. string //class RegistryKey RegistryKey try { //SetValue:存s儲x值E的o名W稱U run.SetValue(“csbootrun”, starupPath); MessageBox.Show(“已w啟ÓO用DI開機¡Ò運B行a!”, “提¦¢G示DU”, MessageBoxButtons.OK, loca.Close(); } { MessageBox.Show(ee.Message.ToString(), } } private { //獲o取Lu程g式!執Xo行a路Mo徑|.. string //class RegistryKey RegistryKey try { //SetValue:存s儲x值E的o名W稱U run.DeleteValue(“csbootrun”); MessageBox.Show(“已w停X¡Ó止i開機¡Ò運B行a!”, “提¦¢G示DU”, MessageBoxButtons.OK, loca.Close(); } catch { MessageBox.Show(ee.Message.ToString(), } } } } _ |