修改注册表键值 [英] modifying the registry key value
本文介绍了修改注册表键值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下的注册表路径
HKEY_LOCAL_MACHINE\SOFTWARE\COMPANY\COMPFOLDER
在 COMPFOLDER
,我有一个名为杰诺,其值为0。我想通过code,每当我执行它的值改为1字符串值code。谁能帮我?
inside COMPFOLDER
, I have a string value called "Deno" whose value is 0. I wish to change its value to 1 by code whenever I execute the code. Can anyone help me?
推荐答案
这已经有一段时间我没章的黑客,但这样的事情可以工作:
It's been a while I did reg hacks, but something like this could work:
RegistryKey myKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Company\\Compfolder", true);
if(myKey != null)
{
myKey.SetValue("Deno", "1", RegistryValueKind.String);
myKey.Close();
}
这篇关于修改注册表键值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文