定位注册表

private void PositionRegedit(RegistryKey regKey,string regPath)        {            RegistryKey reg = regKey;            RegistryKey regg = reg.CreateSubKey(@"Software/Microsoft/Windows/CurrentVersion/Applets/Regedit", RegistryKeyPermissionCheck.ReadWriteSubTree);            regg.SetValue("LastKey", "我的电脑//" + regPath , RegistryValueKind.String);            regg.Flush();            regg.Close();            reg.Close();            Process[] p = Process.GetProcessesByName("regedit");            foreach (Process p1 in p) p1.Kill();            Process.Start("regedit.exe");        }

相关文章