static void PrintKeys(RegistryKey rkey) { // Retrieve all the subkeys for the specified key. String [] names = rkey.GetSubKeyNames(); // Print the contents of the array to the console. foreach (String s in names) { Console.WriteLine(s); } }static void Main() { RegistryKey rk = Registry.LocalMachine.OpenSubKey("SOFTWARE"); PrintKeys(rk); }
static void PrintKeys(RegistryKey rkey) { // Retrieve all the subkeys for the specified key. String [] names = rkey.GetSubKeyNames(); // Print the contents of the array to the console. foreach (String s in names) { Console.WriteLine(s); } }static void Main() { RegistryKey rk = Registry.LocalMachine.OpenSubKey("SOFTWARE"); PrintKeys(rk); }
http://www.yourblog.org/Data/20045/69792.html
http://www.webuc.net/chinahuman/archive/2004/06/02/904.aspxhttp://www.microsoft.com/china/community/program/OriginalArticles/articlelist.mspx
{
// Retrieve all the subkeys for the specified key.
String [] names = rkey.GetSubKeyNames(); // Print the contents of the array to the console.
foreach (String s in names)
{
Console.WriteLine(s);
}
}static void Main()
{
RegistryKey rk = Registry.LocalMachine.OpenSubKey("SOFTWARE"); PrintKeys(rk);
}
我要的是怎样得到所有已经安装的软件的列表。
fancyf的方法可能得到一些信息,但可不可以扫描到软件的名称、版本、大小,就像windows的“更改/删除程序”里列出的一样。
{
// Retrieve all the subkeys for the specified key.
String [] names = rkey.GetSubKeyNames(); // Print the contents of the array to the console.
foreach (String s in names)
{
Console.WriteLine(s);
}
}static void Main()
{
RegistryKey rk = Registry.LocalMachine.OpenSubKey("SOFTWARE"); PrintKeys(rk);
}