Beispiel #1
0
 public static void SetComputationalCADRegistryValue(string name, string value)
 {
     try
     {
         RegistryKey registryKey = Reg.ComputationalCADRegistryKey();
         registryKey.SetValue(name, value, RegistryValueKind.String);
     }
     catch (System.Exception ex)
     {
         throw new System.Exception("Can not write setting " + name + ": " + ex.Message);
     }
 }
Beispiel #2
0
        public static string GetComputationalCADRegistryValue(string name)
        {
            string result;

            try
            {
                RegistryKey registryKey = Reg.ComputationalCADRegistryKey();
                result = (string)registryKey.GetValue(name);
            }
            catch (System.Exception ex)
            {
                throw new System.Exception("Can not read setting " + name + ": " + ex.Message);
            }
            return(result);
        }