怎样修改注册表
怎样修改注册表,最好有相关的例子。谢谢 问题点数:20、回复次数:1Top
1 楼JzeroBiao(先知)回复于 2005-07-07 10:50:53 得分 20
Microsoft.Win32.Registry:
Code:
using System;
using Microsoft.Win32;
class Reg {
public static void Main() {
// Create a RegistryKey, which will access the HKEY_CURRENT_USER
// key in the registry of this machine.
RegistryKey rk = Registry.CurrentUser;
// Print out the keys.
PrintKeys(rk);
}
static void PrintKeys(RegistryKey rkey) {
// Retrieve all the subkeys for the specified key.
String [] names = rkey.GetSubKeyNames();
int icount = 0;
Console.WriteLine("Subkeys of " + rkey.Name);
Console.WriteLine("-----------------------------------------------");
// Print the contents of the array to the console.
foreach (String s in names) {
Console.WriteLine(s);
// The following code puts a limit on the number
// of keys displayed. Comment it out to print the
// complete list.
icount++;
if (icount >= 10)
break;
}
}
}
Top




