c#实现程序开机自动运行(转)
时间:2010-10-13 来源:Jessica Lu
代码如下:
RegistryKey KeyCon=Registry.LocalMachine.OpenSubKey( "Software\\Microsoft\\Windows\\CurrentVersion\\Run",true); string MyKey= "Terminal"; if((string)KeyCon.GetValue(MyKey,"no") == "no")//指定的键不存在 { string Path = Application.StartupPath+@"\Terminal.exe"; KeyCon.SetValue(MyKey,Path); //设置注册表中的启动键 }
原文地址:http://www.cnblogs.com/yulei/archive/2007/06/13/781964.html
RegistryKey KeyCon=Registry.LocalMachine.OpenSubKey( "Software\\Microsoft\\Windows\\CurrentVersion\\Run",true); string MyKey= "Terminal"; if((string)KeyCon.GetValue(MyKey,"no") == "no")//指定的键不存在 { string Path = Application.StartupPath+@"\Terminal.exe"; KeyCon.SetValue(MyKey,Path); //设置注册表中的启动键 }
原文地址:http://www.cnblogs.com/yulei/archive/2007/06/13/781964.html
相关阅读 更多 +