| 发表于:2007-01-24 23:54:386楼 得分:0 |
可以读注册表里面hkey_local_machine\software\microsoft\windows\currentversion\run下面的键值.我写了一个小程序,主要代码如下,希望对你有帮助. 注意:要包含命名空间microsoft.win32 registrykey key1 = registry.localmachine; registrykey key2 = key1.createsubkey( "software "); registrykey key3 = key2.createsubkey( "microsoft "); registrykey key4 = key3.createsubkey( "windows "); registrykey key5 = key4.createsubkey( "currentversion "); registrykey key6 = key5.createsubkey( "run "); //获得其下的所有键值,并写入richtextbox string[] str = key6.getvaluenames(); for (int i = 0; i < str.length; i++) richtextbox1.appendtext(str[i]+ "\n "); | | |
|