日期:2014-05-17 浏览次数:20817 次
试试这个
public void CreateList()
{
RegistryKey RegKey = Registry.LocalMachine;
RegKey = RegKey.OpenSubKey(@"SYSTEM\ControlSet001\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}");
string[] KeysList = null;
if (RegKey.GetSubKeyNames().Length > 0)
KeysList = RegKey.GetSubKeyNames(); //Get List
foreach (string Key in KeysList)
{
//Except "useable" key--"Connection",it's other names "Descriptions";
if (Key == "Descriptions")
continue;
RegistryKey SubKey = RegKey.OpenSubKey(Key);
SubKey = SubKey.OpenSubKey("Connection");
comboBox1.Items.Add(SubKey.GetValue("Name"));
}
}