Thursday, November 29, 2007

Reading and writing to Windows.Registry.

using System.Configuration;
using System.Web.Security;
using System.ComponentModel;
using System.Diagnostics;
using System.Configuration.Install;
using Microsoft.Win32;
 
namespace Install.NameSpace
{
    [RunInstaller(true)]
    public class InstallHelper : Installer
    {
 
    #region Public Static Methods
 
    public static void SaveLocalRoot(String value)
    {
        try
        {
            RegistryKey key = Registry
                .LocalMachine.OpenSubKey(ConfigurationManager
                .AppSettings["LocalRootRegKey"]
                .ToString(), true);
            if (key == null)
            Registry.LocalMachine.CreateSubKey(ConfigurationManager
                .AppSettings["LocalRootRegKey"].ToString());
            key.SetValue("DefaultLocalRoot", value);
        }
        catch (Exception e)
        {
            throw e;
        }
    }
 
    #endregion
 
    }
} 

No comments:

Azure Storage Account Types

Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...