1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
/// <summary>
/// Open a registry sub key
/// If key not exists, it will be created
/// </summary>
/// <param name="StartKey">Key to start from</param>
/// <param name="SubKey">Path of sub key</param>
/// <returns>resulting registry key</returns>
public RegistryKey OpenSubKey(RegistryKey StartKey, String SubKey)
{
String[] SubKeys = SubKey.Split(new Char[] { '\\' });
foreach (String key in SubKeys)
StartKey = StartKey.CreateSubKey(key);
return StartKey;
}
|