代码如下: 
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
posted on 2010-10-13 14:33  Jessica Lu  阅读(223)  评论(0)    收藏  举报