using System; using System.Collections.Generic; using System.Text; using Microsoft.Win32; //using System.Deployment.Application; using System.Security.Permissions; namespace SuperMap.RealEstate.SecurityDevice.Setup.npPlugin { /// public static class RegistryHelper { const string _SubKey = "SOFTWARE"; /// public static void Write(string SubKeyName, string Name, string Value) { string _SubKeyName = _SubKey + "\\" + SubKeyName; using (RegistryKey _RegistryKey = Registry.LocalMachine.CreateSubKey(_SubKeyName)) { _RegistryKey.SetValue(Name, Value); } } /// public static string Read(string SubKeyName, string Name) { try { string _SubKeyName = _SubKey + "\\" + SubKeyName; using (RegistryKey _RegistryKey = Registry.CurrentUser.OpenSubKey(_SubKeyName)) { if (_RegistryKey == null) { return string.Empty; } return _RegistryKey.GetValue(Name).ToString(); } } catch (Exception ex) { throw ex; } } } }