Saturday 12 January 2013

how to find asp.net version installed

Step 1)  Add Namespace Microsoft.Win32

Step 2) how to find asp.net version installed

        void Get_Asp_net_Installed_versions()
        {
            Console.WriteLine();
            Console.WriteLine();
            try
            {
            RegistryKey key = Registry.LocalMachine;

            RegistryKey dotnetkey = key.OpenSubKey(@"SOFTWARE\Microsoft\ASP.NET\",
                                    RegistryKeyPermissionCheck.Default,
                                    System.Security.AccessControl.RegistryRights.FullControl);
           
            foreach (String NameValue in dotnetkey.GetSubKeyNames())
            {
           
            Console.WriteLine("asp.net versions installed {0}", NameValue);
            }
            }
            catch (Exception ex)
            {
            Console.WriteLine(ex.Message);
            }
}
Output

asp.net versions installed 2.0.50727.0
asp.net versions installed 4.0.30319.0

No comments:

Post a Comment