string fileFullName = @System.Windows.Forms.Application.ExecutablePath;
string fileName = fileFullName.Substring(fileFullName.LastIndexOf("\\") + 1);
const string strSubKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run\"; RegistryKey rKey = Registry.LocalMachine.OpenSubKey(strSubKey,true);
if (rKey != null)
{
//MessageBox.Show(rKey.Name);
rKey.SetValue(fileName, fileFullName);//Run下面冒出一个新项 #1
rKey.Close();
this.Menu_config_autoRun.Checked = true;
}
执行该方法后,在Run项下面冒出个子项:新项 #1
不只是怎么回事
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货