Пример #1
0
        static private void GetBooleanRegValuesInternalWow64(string keypath, Hashtable ht, short prodId)
        {
            try
            {
                StringBuilder regVal       = new StringBuilder(2048);
                StringBuilder sbSection    = new StringBuilder(keypath);
                StringBuilder sbKey        = new StringBuilder("");
                StringBuilder sbDefaultVal = new StringBuilder("");
                NCRegistryDLL.GetRegKeys(regVal, sbSection, sbKey, sbDefaultVal, prodId);

                string   keys     = regVal.ToString();
                string[] statKeys = keys.Split(':');

                for (int i = 0; i < statKeys.Length; i++)
                {
                    string subKey = statKeys[i];
                    if (!String.IsNullOrEmpty(subKey))
                    {
                        string result = GetRegValueInternal(keypath, subKey, prodId);
                        ht[statKeys[i]] = Convert.ToBoolean(result);
                    }
                }
            }
            catch (Exception ex)
            {
                AppUtil.LogEvent("RegHelper::Stage 003" + ex.Message + ex.InnerException.Message, EventLogEntryType.Error);
            }
        }
Пример #2
0
        static private string GetRegValueInternal(string section, string key, short prodId)
        {
            try
            {
                StringBuilder regVal       = new StringBuilder(500);
                StringBuilder sbSection    = new StringBuilder(section);
                StringBuilder sbKey        = new StringBuilder(key);
                StringBuilder sbDefaultVal = new StringBuilder("");

                NCRegistryDLL.GetRegVal(regVal, sbSection, sbKey, sbDefaultVal, prodId);

                return(regVal.ToString());
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    AppUtil.LogEvent("RegHelper::Stage 001" + ex.Message + ex.InnerException.Message, EventLogEntryType.Error);
                }
                else
                {
                    AppUtil.LogEvent("RegHelper::Stage 001" + ex.Message, EventLogEntryType.Error);
                }
            }
            return("");
        }