// Retrieves the value of the current version of Pocket Pollster installed on the mobile device.
        public static string GetAppVersion()
        {
            string        version = null;
            CERegistryKey regKey  = GetMobileAppKey();

            if (regKey != null)
            {
                if (regKey.GetValue("Version") != null)
                {
                    version = Tools.DisallowNullString(regKey.GetValue("Version").ToString());
                }

                regKey.Close();
            }

            return(version);
        }
        // Retrieves the "Guid" value, if it exists.
        public static string GetGuid()
        {
            string        guid   = null;
            CERegistryKey regKey = GetMobileAppKey();

            if (regKey != null)
            {
                if (regKey.GetValue("Guid") != null)
                {
                    guid = Tools.DisallowNullString(regKey.GetValue("Guid").ToString());
                }

                regKey.Close();
            }

            return(guid);
        }
        // Checks whether the "StopAskingToInstall" flag exists and is set true.
        public static bool InstallPromptOkay()
        {
            bool          okayToProceed = true;
            CERegistryKey regKey        = GetMobileAppKey();

            if (regKey != null)
            {
                if (regKey.GetValue("StopAskingToInstall") != null)
                {
                    string regStr = regKey.GetValue("StopAskingToInstall").ToString();
                    okayToProceed = (regStr == "1") ? false : true;
                }
                regKey.Close();
            }

            return(okayToProceed);
        }
        // Retrieves the "DataPath" value, if it exists.
        public static string GetDataPath()
        {
            string        path   = null;
            CERegistryKey regKey = GetMobileAppKey();

            if (regKey != null)
            {
                if (regKey.GetValue("DataPath") != null)
                {
                    path = regKey.GetValue("DataPath").ToString();
                    path = Tools.EnsureFullPath(path);
                }

                regKey.Close();
            }

            return(Tools.DisallowNullString(path));
        }
Пример #5
0
        private object ReadRegistry(CERegistryKey rootKey, string name, params string[] subKeys)
        {
            CERegistryKey key = rootKey;

            foreach (string subKey in subKeys)
            {
                key = key.CreateSubKey(subKey);
            }

            return(key.GetValue(name));
        }