/// <summary> /// This method store the information into registry /// </summary> /// <param name="regPath">the registry path</param> /// <returns><c>true</c> if the values were saved to the registry</returns> private bool SaveValuesToPath(string regPath) { RegistryKey key = Registry.CurrentUser.CreateSubKey(regPath); if (key == null) { return(false); } // convert to regsz string strCheckForUpdate = true.ToString(); // always check for updates next time! string strLastCheckTime = ConvertDateToString(LastCheckTime); string strSkipThisVersion = LastVersionSkipped; string strDidRunOnc = DidRunOnce.ToString(); string strProfileTime = ConvertDateToString(LastConfigUpdate); string strPreviousVersion = InstalledVersion; // set the values key.SetValue("CheckForUpdate", strCheckForUpdate, RegistryValueKind.String); key.SetValue("LastCheckTime", strLastCheckTime, RegistryValueKind.String); key.SetValue("SkipThisVersion", strSkipThisVersion, RegistryValueKind.String); key.SetValue("DidRunOnce", strDidRunOnc, RegistryValueKind.String); key.SetValue("LastProfileUpdate", strProfileTime, RegistryValueKind.String); key.SetValue("PreviousVersionRun", strPreviousVersion, RegistryValueKind.String); return(true); }
/// <summary> /// This method store the information into registry /// </summary> /// <param name="regPath"></param> /// <returns></returns> private Boolean SaveValuesToPath(String regPath) { RegistryKey key = Registry.CurrentUser.CreateSubKey(regPath); if (key == null) { return(false); } else { // convert to regsz String strCheckForUpdate = CheckForUpdate.ToString(); String strLastCheckTime = LastCheckTime.ToString(); String strSkipThisVersion = SkipThisVersion.ToString(); String strDidRunOnc = DidRunOnce.ToString(); String strProfileTime = LastProfileUpdate.ToString(); // set the values key.SetValue("CheckForUpdate", strCheckForUpdate, RegistryValueKind.String); key.SetValue("LastCheckTime", strLastCheckTime, RegistryValueKind.String); key.SetValue("SkipThisVersion", strSkipThisVersion, RegistryValueKind.String); key.SetValue("DidRunOnce", strDidRunOnc, RegistryValueKind.String); key.SetValue("LastProfileUpdate", strProfileTime, RegistryValueKind.String); return(true); } }
/// <summary> /// This method store the information into registry /// </summary> /// <param name="regPath">the registry path</param> /// <returns><c>true</c> if the values were saved to the registry</returns> private void SaveValuesToPath(string regPath) { RegistryKey key = Registry.CurrentUser.CreateSubKey(regPath); if (key == null) { return; } // convert to regsz String strCheckForUpdate = CheckForUpdate.ToString(); String strLastCheckTime = LastCheckTime.ToString(CultureInfo.InvariantCulture); String strSkipThisVersion = SkipThisVersion; String strDidRunOnc = DidRunOnce.ToString(); String strProfileTime = LastProfileUpdate.ToString(CultureInfo.InvariantCulture); // set the values key.SetValue("CheckForUpdate", strCheckForUpdate, RegistryValueKind.String); key.SetValue("LastCheckTime", strLastCheckTime, RegistryValueKind.String); key.SetValue("SkipThisVersion", strSkipThisVersion, RegistryValueKind.String); key.SetValue("DidRunOnce", strDidRunOnc, RegistryValueKind.String); key.SetValue("LastProfileUpdate", strProfileTime, RegistryValueKind.String); }