using System; using Microsoft.Win32; using System.Reflection; namespace Ease.SvcHost { public class RegistryHelper { public static RegistryKey GetServiceKey(string name) { RegistryKey system = Registry.LocalMachine.OpenSubKey("System"); RegistryKey currentControlSet = system.OpenSubKey("CurrentControlSet"); RegistryKey services = currentControlSet.OpenSubKey("Services"); return services.OpenSubKey(name, true); } public static RegistryKey GetParameterKey(string name) { RegistryKey system = Registry.LocalMachine.OpenSubKey("System"); RegistryKey currentControlSet = system.OpenSubKey("CurrentControlSet"); RegistryKey services = currentControlSet.OpenSubKey("Services"); RegistryKey service = services.OpenSubKey(name); return service.OpenSubKey("Parameters"); } private RegistryHelper() {} } }